Overview
Run a coding agent such as OpenHands in a sandbox to reproduce a bug in an open-source tool, write a failing regression test, make the smallest fix, and prepare a pull request for maintainers.
Problem or Objective
- Which agents turn an issue report into a fix?
- Which agents write or run tests against an application?
More in Coding and Code Review
AI Agents and Models
Tools and Integrations
- Tools
- OpenHands · Docker
- Prerequisites
- Docker, a model provider API key, and a fork of the project you want to fix.
How It Works
Fork the project and clone it into a workspace the agent can use; OpenHands runs each conversation in its own Docker container. Give the agent the bug report, the steps to reproduce it and the command that runs the test suite. Ask it to reproduce the defect first and to write a test that fails because of it, then to make the smallest change that makes the test pass without breaking other tests. Read the diff and the test yourself, run the full suite locally, and follow the project's contributing guide. Open the pull request from your own account, describe how the bug was reproduced, and say that an AI agent helped if the project asks for that.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up OpenHands.
- Connect the toolsConnect the tools this workflow relies on: OpenHands, Docker.
- Check the prerequisitesDocker, a model provider API key, and a fork of the project you want to fix.
- Gather your detailsCollect what the prompt asks for: Path to your fork, Bug description and steps to reproduce, Command that runs the tests.
- Run the starter promptPaste the starter prompt below into OpenHands and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at openhands.dev before you rely on it.
Practical Starter Prompt: Reproduce a bug and fix it with a regression test
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
In the repository at [Path to your fork], investigate this bug: [Bug description and steps to reproduce]. First reproduce it and show me the output. Then write a test that fails because of the bug, using the existing test style, and run it with [Command that runs the tests]. Make the smallest code change that makes the new test pass and keeps the other tests passing. Do not push, open a pull request or contact maintainers. Stop and show me the diff, the test and the test output for my review.Review the diff and the new test yourself and run the full suite. Open the pull request from your own account only after you approve the change.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. OpenHands describes itself as an open source platform for software engineering agents with a GUI, CLI and SDK, and its README says each new conversation can run in its own Docker container. The pages do not describe bug fixing or test writing results, and nothing here shows whether a maintainer would accept such a change.
Limitations and Considerations
Many open-source projects have rules on AI-assisted contributions; read the contributing guide before opening a pull request. Treat the change as a proposal until maintainers review it. Running the agent needs a model provider key, which costs money per use. Keep the sandbox away from your own credentials and private repositories. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Related Videos
About OpenHands/OpenHands
Setting up a CVE Remediation Factory with OpenHands (opens in a new tab)
Walkthrough of OpenHands by OpenHands: it is on the project’s own channel.
Watch on YouTube (opens in a new tab)About OpenHands/OpenHands
One AI Agent, Multiple LLMs: Automatic Model Routing in OpenHands (opens in a new tab)
Published by the project’s official channel.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- OpenHands (opens in a new tab)
Project documentation · openhands.dev · Undated · Source checked 25 Nov 2026, 11:59 UTC
What this source supports
- OpenHands is an open source platform for software engineering agents that gives developers a GUI, CLI, SDK, and enterprise control plane for running coding agents across real engineering workflows.
- OpenHands/OpenHands README (opens in a new tab)
Project documentation · github.com · Undated · Source checked 25 Nov 2026, 11:59 UTC
What this source supports
- Agent Canvas runs the open source OpenHands agent out-of-the-box, but can use third-party agents such as Claude Code, Codex, Gemini CLI, Pi, and OpenCode.
- Run each new conversation in its own Docker container, with its own Agent Server and tools.

