Reproduce a reported bug before attempting a fix
An agent writes a failing script or test that shows the bug in a sandbox, then fixes it and shows the test now passes.
The use case
Many bug reports never get reproduced, so fixes are guesses. Open-source agents such as SWE-agent and OpenHands work through a GitHub issue in a sandbox: they explore the repo, write a small script or test that triggers the bug, change code, and rerun until the reproduction passes. Having the failing test first gives the reviewer evidence that the fix addresses the reported behavior. Maintainers still check the reproduction actually matches the report, review the patch for side effects, and keep the new test in the suite so the bug stays fixed.
Example workflow
- Give the agent the issue text and repository
- Agent writes a reproduction script or failing test
- Agent edits code until the reproduction passes
- Reviewer checks the reproduction matches the report
- Merge the fix with the new test
Tools
- SWE-agent
- OpenHands
- Docker
Risks and guardrails
- Reproduction may test a different bug than the one reported
- Run agents in containers without production credentials
- Patches can pass the new test and break others; run the full suite
Sources
Written by Agents Lookup. Credits and official pages for the tools this use case names:
- SWE-agent on GitHub: github.com/SWE-agent/SWE-agent
- OpenHands on GitHub: github.com/OpenHands/OpenHands
- SWE-agent (official page): github.com/SWE-agent/SWE-agent (checked 2026-11-19)
- OpenHands (official page): www.openhands.dev (checked 2026-11-19)
- Docker MCP Catalog and Toolkit (official page): docs.docker.com/ai/mcp-catalog-and-toolkit (checked 2026-11-09)