Use the TestRail action directly in test-plan-generator - #6657
Merged
Conversation
The agent submitted its plan through a private submit_result MCP tool, and __main__ then copied that structured result into the TestRail action. The action existed but was never the thing the agent called. Expose testrail.submit_test_plan to the agent as a recordable action instead, and drop the result module: the action schema is now the only definition of a generated test plan. The per-case `context` label goes with it, and the case count and sequential-id checks move from TestPlanResult onto SubmitTestPlanInput, where they are enforced for every caller. Recording twice would create two TestRail suites, so a second call is now rejected. The agent's own findings become its closing prose, so the UI reads the plan from the recorded action's params, falling back to findings.result for runs recorded before this change. Fixes mozilla#6508
This was referenced Aug 19, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates the test-plan-generator agent to record the testrail.submit_test_plan action directly (instead of submitting a separate structured “result” and then copying it into an action), making the action schema the single source of truth for generated test plans and aligning the UI to read plans from recorded actions.
Changes:
- Expose and enforce
testrail.submit_test_planas the agent’s direct, recordable output (including single-submission protection and schema-level validation like max case count and sequential IDs). - Remove the agent-local
resultmodel/server and update the agent prompt/config/runtime wiring to use the actions server/tooling. - Update the UI to parse/render test plans from recorded actions (with fallback for legacy runs) and adjust runtime tests to match the new schema (removal of per-case
context).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| services/hackbot-ui/components/TestPlanView.tsx | Parse test plan from recorded testrail.submit_test_plan action params with legacy fallback. |
| services/hackbot-ui/components/RunDetail.tsx | Render Findings/TestPlan UI even when findings are empty but the plan action exists. |
| services/hackbot-ui/components/FindingsView.tsx | Thread actions into test-plan parsing for test-plan-generator runs. |
| libs/hackbot-runtime/hackbot_runtime/actions/testrail.py | Enforce plan constraints in action schema; reject multiple submissions; remove deprecated helper. |
| libs/hackbot-runtime/tests/test_testrail_action.py | Update/extend tests for new validation (sequential IDs, max cases, single submission) and removed context. |
| libs/hackbot-runtime/tests/test_testrail_handler.py | Update fixture data to remove per-case context. |
| agents/test-plan-generator/hackbot_agents/test_plan_generator/prompts/system.md | Update agent workflow instructions to record the TestRail action and move “context” guidance into prompt text. |
| agents/test-plan-generator/hackbot_agents/test_plan_generator/config.py | Restrict agent to the testrail.submit_test_plan action type. |
| agents/test-plan-generator/hackbot_agents/test_plan_generator/agent.py | Replace submit-result MCP server usage with actions server; require TestRail plan action to be recorded. |
| agents/test-plan-generator/hackbot_agents/test_plan_generator/main.py | Stop copying structured results into an action; rely on the agent-recorded action. |
| agents/test-plan-generator/hackbot_agents/test_plan_generator/result.py | Deleted (structured result server/model removed). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
suhaibmujahid
requested changes
Aug 19, 2026
suhaibmujahid
left a comment
Member
There was a problem hiding this comment.
Thank you! We need some minor changes.
suhaibmujahid
approved these changes
Aug 20, 2026
suhaibmujahid
enabled auto-merge (squash)
August 20, 2026 23:52
jpangas
added a commit
to jpangas/bugbug
that referenced
this pull request
Aug 21, 2026
The step-level `StepResult` model went away with result.py in mozilla#6657, so `TestRailStepInput` now holds only an action and an expectation. The execution rules still told the agent to mark a failing step, which it has no field to do. Point that failure at the case result instead, and have the agent name the offending step in the summary so the attribution the step status used to carry is not lost.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6508
What changed
testrail.submit_test_planis now exposed to the agent as a recordable action, and theresultmodule is gone: the action schema is the only definition of a generated test plan.contextlabel goes with it. It was guidance for tool selection, so it moves into the prompt where that judgment belongs, rather than being carried as data nothing consumed.TestPlanResultontoSubmitTestPlanInput, so they are enforced for every caller instead of only the ones going through the old result model.submit_test_plancall is rejected.findings.resultfor runs recorded before this change.Note
Between this PR and the next one in the chain, the action does not yet carry execution results, so the UI renders test cases without pass/fail badges. That is restored by #6658, which nests the result inside each case. Merging the two together avoids exposing the gap on
master.Stack
Please merge in this order each builds on the one before:
test-plan-generatoragent's execution results in TestRail #6436, submit execution results to TestRail