Failing test reproduced and patched
The agent reads the CI failure, checks out the branch, reproduces the failure, edits the code and runs the tests before opening a pull request. It never edits a test without flagging it, so a real bug is not hidden. You review the patch.
What the agent does
- 1
Read the CI failure.
- 2
Check out the branch.
- 3
Reproduce the failure.
- 4
Edit the code.
- 5
Run the tests.
- 6
Open a pull request. → developer reviews the patch
Enough to decide?
Proposed pattern- Required input
- No example input written yet
- Example output
- No example output written yet
- Stop condition
- masking a real bug; no test edits without flag
- Reviewer
- Not yet independently reviewed
- Last run
- Not run by us yet
What it costs to run
A rough range per run, from the cheapest to the dearest of the paid models we checked. Your real cost depends on how much text you send.
Checked 2026-11-25 source
$0.001 to $0.38 per run · $0.019 per run with a mid-priced model
- Small, cheap model
- $0.001 per runPer 100 runs: $0.13
- Typical
- $0.019 per runPer 100 runs: $1.92
- Large model
- $0.38 per runPer 100 runs: $38.40
Free tiers and local models can bring this to zero while you test.
How we worked this out
- 6 model calls, one per step (at least 2)
- 2,000 input tokens per call
- 800 output tokens per call
- each call re-reads the earlier outputs
- no retries, no loops, no cached-input discount
- Longer inputs cost more; agents that retry or loop use more calls.
- Free tiers may cover small volumes: see free AI tokens.
- Local models have no per-token price but need your own hardware.
Works with
Tags
Before you start
- Access the agent needs
- code-repo, cloud-console
- Who approves
- developer reviews the patch
- What to log
- every action it proposes and the decision taken
- When to stop
- masking a real bug; no test edits without flag
Why it is worth it
A red build blocks everyone. An agent that reproduces the failure and proposes a fix gets the team moving while you decide.
Start this week
- Point the agent at one failing CI run, with read access to the branch.
- Let it reproduce the failure locally and open a pull request with the fix and the test output.
- Review the change. Reject any patch that edits a test without explaining why.
Watch out for
Changing the test to pass hides the bug. Flag every test edit.
Measure this
Time from red build to green.
About this entry
Proposed pattern Checked 2026-11-27 Next check 2026-12-25 v2026-11-26.1
What we checked
| Item | Result | Date | By | Source and note |
|---|---|---|---|---|
| Text and steps | Checked | 2026-11-25 | — | — |
| Human checkpoint and risks | Checked | 2026-11-25 | Reviewer to be named | — |
| Workflow run | Not checked yet | — | — | — |
| Cost estimate | Checked | 2026-11-25 | — | source · mid-priced model assumed |
| Tool links | Not checked yet | — | — | — |
| Outside evidence | Not checked yet | — | — | — |
Limitations
- This is a pattern written from how the job is usually done. We have not run it.
- Steps, tools and risks are general. Your systems and rules will differ.
- Test it with made-up or public data before using real data.
- Not checked yet: workflow run, tool links, outside evidence.
Change history
- Long text added: why it is worth it, how to start, what to watch out for, how to measure it spec v2026-11-26.1
- Added to the catalogue spec v2026-11-25.1
Evidence
- No outside evidence yet; this is our own analysis.
Spec versions
- v2026-11-26.1 · Long text added: why it is worth it, how to start, what to watch out for, how to measure it
- v2026-11-25.1 · Added to the catalogue
Run it with AI
Pick the AI you already use.
You are helping developer. Goal: Failing test reproduced and patched. The agent reads the CI failure, checks out the branch, reproduces the failure, edits the code and runs the tests before opening a pull request. It never edits a test without flagging it, so a real bug is not hidden. You review the patch. Work through these steps and show your result for each: 1. Read the CI failure. 2. Check out the branch. 3. Reproduce the failure. 4. Edit the code. 5. Run the tests. 6. Open a pull request. Tools or data I can give you: code-repo, cloud-console. Ask me for anything missing before you start. Do not take any action yourself; stop for my decision where: developer reviews the patch. Watch for: masking a real bug; no test edits without flag.
Opens the tool with your prompt already filled in. Review it there before you send.
Copies the prompt, then opens the tool. Paste it in to start.
Nothing happened? The Claude Desktop app (Mac, Windows, or Linux, where it is still in beta) may not be installed. Use the copy button instead.
ROLE: Assistant for developer. TASK: Failing test reproduced and patched. SUMMARY: The agent reads the CI failure, checks out the branch, reproduces the failure, edits the code and runs the tests before opening a pull request. It never edits a test without flagging it, so a real bug is not hidden. You review the patch. PROCEDURE: 1. Read the CI failure. 2. Check out the branch. 3. Reproduce the failure. 4. Edit the code. 5. Run the tests. 6. Open a pull request. HUMAN CHECKPOINT: developer reviews the patch GUARDRAILS: masking a real bug; no test edits without flag RULES: ask when inputs are missing; never invent facts; cite where each fact came from.
Copies the prompt, then opens the tool. Paste it in to start.
{
"name": "failing-test-fixer-0073",
"goal": "Failing test reproduced and patched",
"persona": [
"developer"
],
"autonomy": "supervised",
"tools": [
"code-repo",
"cloud-console"
],
"plan": [
"Read the CI failure.",
"Check out the branch.",
"Reproduce the failure.",
"Edit the code.",
"Run the tests.",
"Open a pull request."
],
"human_in_the_loop": "developer reviews the patch",
"guardrails": "masking a real bug; no test edits without flag",
"output": "a draft for human review"
}Copies the prompt, then opens the tool. Paste it in to start.
{
"trigger": "When a new item arrives",
"steps": [
{
"n": 1,
"do": "Read the CI failure."
},
{
"n": 2,
"do": "Check out the branch."
},
{
"n": 3,
"do": "Reproduce the failure."
},
{
"n": 4,
"do": "Edit the code."
},
{
"n": 5,
"do": "Run the tests."
},
{
"n": 6,
"do": "Open a pull request."
}
],
"connects": [
"code-repo",
"cloud-console"
],
"approval": "developer reviews the patch",
"stop_on": "masking a real bug; no test edits without flag"
}Copies the prompt, then opens the tool. Paste it in to start.
{
"name": "failing-test-fixer-0073",
"goal": "Failing test reproduced and patched",
"persona": [
"developer"
],
"autonomy": "supervised",
"tools": [
"code-repo",
"cloud-console"
],
"plan": [
"Read the CI failure.",
"Check out the branch.",
"Reproduce the failure.",
"Edit the code.",
"Run the tests.",
"Open a pull request."
],
"human_in_the_loop": "developer reviews the patch",
"guardrails": "masking a real bug; no test edits without flag",
"output": "a draft for human review"
}Opens the tool with your prompt already filled in. Review it there before you send.
Copies the prompt, then opens the tool. Paste it in to start.
You are helping developer. Goal: Failing test reproduced and patched. The agent reads the CI failure, checks out the branch, reproduces the failure, edits the code and runs the tests before opening a pull request. It never edits a test without flagging it, so a real bug is not hidden. You review the patch. Work through these steps and show your result for each: 1. Read the CI failure. 2. Check out the branch. 3. Reproduce the failure. 4. Edit the code. 5. Run the tests. 6. Open a pull request. Tools or data I can give you: code-repo, cloud-console. Ask me for anything missing before you start. Do not take any action yourself; stop for my decision where: developer reviews the patch. Watch for: masking a real bug; no test edits without flag.
Copies the prompt, then opens the tool. Paste it in to start.
You are helping developer. Goal: Failing test reproduced and patched. The agent reads the CI failure, checks out the branch, reproduces the failure, edits the code and runs the tests before opening a pull request. It never edits a test without flagging it, so a real bug is not hidden. You review the patch. Work through these steps and show your result for each: 1. Read the CI failure. 2. Check out the branch. 3. Reproduce the failure. 4. Edit the code. 5. Run the tests. 6. Open a pull request. Tools or data I can give you: code-repo, cloud-console. Ask me for anything missing before you start. Do not take any action yourself; stop for my decision where: developer reviews the patch. Watch for: masking a real bug; no test edits without flag.
Copies the prompt, then opens the tool. Paste it in to start.
{
"name": "failing-test-fixer-0073",
"goal": "Failing test reproduced and patched",
"persona": [
"developer"
],
"autonomy": "supervised",
"tools": [
"code-repo",
"cloud-console"
],
"plan": [
"Read the CI failure.",
"Check out the branch.",
"Reproduce the failure.",
"Edit the code.",
"Run the tests.",
"Open a pull request."
],
"human_in_the_loop": "developer reviews the patch",
"guardrails": "masking a real bug; no test edits without flag",
"output": "a draft for human review"
}Copies the prompt, then opens the tool. Paste it in to start.
{
"name": "failing-test-fixer-0073",
"goal": "Failing test reproduced and patched",
"persona": [
"developer"
],
"autonomy": "supervised",
"tools": [
"code-repo",
"cloud-console"
],
"plan": [
"Read the CI failure.",
"Check out the branch.",
"Reproduce the failure.",
"Edit the code.",
"Run the tests.",
"Open a pull request."
],
"human_in_the_loop": "developer reviews the patch",
"guardrails": "masking a real bug; no test edits without flag",
"output": "a draft for human review"
}Copies the prompt, then opens the tool. Paste it in to start.
At a glance
- For
- developer
- Industry
- software
- Autonomy
- supervised
- Difficulty
- Works with
- Steps
- 6 · 1 human checkpoint
- Runs as
- event-triggered
- Needs approval
- developer reviews the patch
- What it costs to run
- $0.019 per run with a mid-priced model
- Evidence
- ID
UC-0073
Compare routes for this job
Share this comparison| For this job | n8n | Claude | ChatGPT | Claude Code |
|---|---|---|---|---|
| What you do by hand | Build and test the workflow once. After that it runs on each new item, and you do the human checkpoint this use case names (approve, edit or decide) before anything goes out. | Paste or attach the input each time, check the answer, and carry the result to where it goes yourself. | Set up the assistant once with your instructions and files. Then paste or attach each new input, check the answer and carry the result on. | Describe the task, then review every change it proposes before you accept it. |
| Human checkpoint | developer reviews the patch | |||
| Typical API cost (same for every route) | $0.019 per run with a mid-priced model checked 2026-11-25 · pricing source | |||
| Learning curve | Terminal | Point and click | Point and click | Terminal |
| Price model | free | free tier | free tier | paid |
| Where your data goes | It runs where you install it. Your workflow data goes to the apps and models it connects to. By default n8n also sends anonymous usage data to its makers; our beginner guide switches that off. | What you type and upload goes to Anthropic's servers and is handled under its terms. Check its data settings before you use real work data. | What you type and upload goes to OpenAI's servers and is handled under its terms. Check its data settings before you use real work data. | Your code and prompts go to Anthropic, or to the cloud provider you set it up with, under that provider's terms. |
| Before you start | Docker or a similar tool on your computer, or a server. Our tested examples have a beginner guide. | An account on the website. The free plan is enough to try it. | An account on the website. The free plan is enough to try it. | A paid Claude plan or API credit, then install it and open a terminal in your project. |
| Evidence for this route | Proposed pattern | Proposed pattern | Proposed pattern | Proposed pattern |
| Open | Open in run panel Tool page | Open in run panel Tool page | Open in run panel Tool page | Open in run panel Tool page |
Where to go from here
All developer use casesSimilar work
These use cases do the same kinds of work as this one. Each card shows what they have in common.
Dependency upgrades with tests
The agent updates one group of outdated packages at a time, runs the tests and fixes simple compile errors. It opens a pull request with notes from the changelog and pinned versions. You merge.
Simple merge conflicts resolved and explained
The agent resolves simple merge conflicts, runs the tests and comments on each choice it made. You approve the merge.
Dependency update watcher for client repositories
The agent scans client repos for outdated and vulnerable packages and runs the tests on an update branch. It opens a pull request only when tests pass, never auto-merges, and reports to the client.
Same kinds of tools, a different job
These use cases connect to the same kinds of tools as this one, so part of your setup carries over.
Notebook reproducibility check
The agent reruns each notebook in a clean environment with fixed seeds and compares the outputs with the saved ones, reporting differences. The author fixes them.
API drift between implementation and spec
The agent calls the test environment, compares responses with the API spec using fixtures and opens issues for mismatches. Your team fixes them.
Cloud config drift against infrastructure code
The agent compares live cloud configuration with your infrastructure code, classifies the drift and opens a pull request or ticket. It only plans, never applies destructive changes, and an engineer approves any apply.