Bug Fix Workflow
The most powerful feature of ContextQA MCP. Automate the entire cycle from bug report to verified fix — reproduce, investigate, fix, and verify — all through your AI assistant.
How It Works
The bug fix workflow orchestrates four stages. Your AI assistant handles the tool calls — you just have a conversation.
Creates a targeted reproduction test case from your bug ticket. Executes it to confirm the bug actually exists. Returns investigation results with fix suggestions and relevant code pointers.
Aggregates telemetry data — network logs, console errors, DOM snapshots, and traces. Performs root cause analysis and optionally queries your repo to locate the responsible code.
You apply the fix (the AI gives you guidance) and deploy to your test environment. This is the only manual step — the rest is automated.
Re-runs the reproduction test against your live environment. If it passes, the fix worked. If it fails, iterate back to step 3. Once verified, generate a structured fix report for your ticket.
Step-by-Step Guide
Step 1: Start the Bug Fix
Paste the bug ticket details into your AI assistant. Include as much context as possible — the URL, steps to reproduce, and optionally your repo URL.
Fix this bug:
Title: Checkout fails when applying discount code
Description: Users report that entering a valid discount code
on the checkout page returns "Invalid code" error.
URL: https://staging.myapp.com/checkout
Steps to reproduce:
1. Add any item to cart
2. Go to checkout
3. Enter code SAVE20
4. Click Apply
Our repo is at https://github.com/myorg/myapp
What happens behind the scenes:
- A reproduction test case is created from the ticket details
- The test is executed against the live URL
- Investigation results are returned with root cause analysis
- If a repo URL is provided, relevant code files are identified
- Fix suggestions are generated based on the findings
Step 2: Review the Investigation
The AI will return a detailed investigation including:
- Confirmation that the bug was reproduced (test failed as expected)
- Network log analysis (failed API calls, error responses)
- Console error summary
- Fix suggestions with code pointers
- A link to watch the test execution recording
You can ask follow-up questions:
Show me the full network logs for the failed request.
What console errors appeared during the test?
Get me the trace URL so I can watch the recording.
Step 3: Apply the Fix
Based on the investigation, fix the code and deploy to your test environment. This is the only part you do manually.
Step 4: Verify the Fix
Once deployed, ask the AI to re-run the reproduction test:
I've deployed the fix. Verify if the bug is fixed.
The verification will re-execute the same test case against the current live state:
Step 5: Report to Ticket
After a successful verification, generate a structured fix report. The ContextQA tool returns the report body; your assistant posts it through a separate Linear/Jira connector call when authorized:
Post the fix report to the ticket. The fix was: [brief description of what you changed]
The report includes: resolution status, verification results, elapsed time, execution URL, and a recommendation to close the ticket.
Example Conversation
Here's what a complete bug fix session looks like:
Title: Login page shows "undefined" error after submitting valid credentials
URL: https://staging.myapp.com/login
Steps: Enter valid email/password, click Sign In
Repo: https://github.com/myorg/myapp
Root cause: The login API returns
{ token: "..." } but the frontend expects { access_token: "..." }. The response mapping in src/auth/login.ts:42 tries to access res.access_token which is undefined.Suggested fix: Update the response mapping to use
res.token instead of res.access_token, or update the API to return access_token.You can watch the test execution here: [trace URL]
Ready to post the fix report to the ticket?
Status: FIXED | Verified: PASSED | Time: 12 minutes
Resolution: Updated response mapping in login.ts to use correct token field name.
Important Rules
What to Include in Your Bug Report
The more context you provide, the faster and more accurate the fix will be.
| Field | Required | Why It Matters |
|---|---|---|
| Bug description | Required | The AI uses this to understand what's broken |
| URL | Required | The test needs a target to run against |
| Steps to reproduce | Recommended | Improves reproduction accuracy significantly |
| Repo URL | Optional | Enables code-level investigation and specific fix suggestions |
| Knowledge base ID | Optional | Applies custom test rules (e.g., accessibility checks) |
| Deployment info | Optional | Helps the AI understand your deployment pipeline |