Skip to content
agentboards

Code & PRs · Practical AI guide

AI keeps fixing the same bug? Use a reproduction first

Trade guesses for a reproduction and one hypothesis.

By AgentBoards · Published · Editorial guidance with an illustrative example; no product benchmark or guaranteed outcome.

When the third fix still fails, preserve the evidence before another edit. Record the exact action, expected result, actual result and environment. Ask the agent to explain one likely cause and a check that could disprove it. That makes the next change an investigation you can assess instead of another guess.

Start with these three steps

  1. Record expected behavior, actual behavior, and the exact error.
  2. Find a minimal way to reproduce it.
  3. Test one cause, then add a regression check where useful.

Illustrative example

Make the request concrete

A checkout button creates two draft orders when clicked twice quickly. Disabling the button appeared to fix it, but the duplicate also happens after a slow network retry.

Reproduce duplicate draft orders with two requests for the same checkout attempt. Expected: one draft order. Previous attempt: disabled the button, but a retried request still duplicates it. Trace the request handler and storage write. Test whether the server recognizes a repeated attempt before editing. Keep unrelated checkout behavior unchanged.

What to check afterward

  • The original rapid-click reproduction produces one draft order after the fix.
  • A repeat request for the same attempt resolves to that order; a genuinely new attempt can create a new order.
  • A failed request leaves the user able to retry, and the existing checkout checks still pass.

A prompt you can adapt

Replace the [brackets] with your task and use only information appropriate for your tool.

Investigate this failure: [error and reproduction]. Expected: [expected]. Previous attempts: [attempts]. Before editing, explain the leading hypothesis and what evidence would disprove it. Make the smallest supported fix and rerun the reproduction.

Watch for this failure

Changing several unrelated things between attempts.

If the agent cannot run the reproduction, keep the result marked unverified and record the missing environment or access. Do not treat a plausible explanation as a confirmed root cause. For payment or account changes, review the affected server behavior and failure paths before release.

You’re done when: The original reproduction passes and nearby behavior still works.

Further reading

These sources explain related practices. The example and prompt above are AgentBoards editorial material, not provider tests or endorsements.

↑↓ navigate · Enter open · Esc close546 agents + guides