microsoft/debug-gym
A Text-Based Environment for Interactive Debugging
What it solves
debug-gym is a framework for testing and improving how AI agents debug Python code. Instead of just asking an LLM to fix a bug, it gives the agent a realistic environment where it can explore the code, run commands, set breakpoints, and test fixes — similar to how a human developer would. It helps researchers and developers evaluate and build better debugging agents.
How it works
The framework simulates a coding environment. An LLM-based agent receives text descriptions of the code state and available tools, then issues commands (like running bash, searching with grep, or stepping through code with pdb). The environment executes those commands and returns new text observations. The agent iterates until it proposes a patch, which is then tested against a test suite.
Key components:
- Environment (gym): manages the code repository and tools
- Tools: bash, view, eval, pdb, grep, listdir, edit, submit, MCP tools
- Agents: froggy_agent (primary), solution_agent (oracle for validation)
- LLM backends: OpenAI, Azure OpenAI, Hugging Face/vLLM, Anthropic
- Terminals: Docker or Kubernetes for isolated execution
- Benchmarks: aider, swebench, swesmith, r2egym, mini_nightmare
Who it's for
Researchers studying LLM debugging capabilities, developers building debugging agents, and anyone wanting to evaluate how well AI models can fix bugs in real code repositories.
Highlights
- Modular tool system — users can create custom tools
- Supports multiple LLM backends (OpenAI, Azure, Hugging Face/vLLM, Anthropic)
- Docker and Kubernetes terminals for isolated execution
- Timeout mechanisms to prevent hanging
- Human mode for manual interaction
- Customizable system prompts via Jinja templates
- Works with popular benchmarks (SWE-bench, SWE-smith, R2E-Gym, Aider)
- Custom repository debugging support
Related
- Project
- Project
- Project
- Project
- Project