debug-gym  by microsoft

Interactive debugging framework for Python code

created 9 months ago
254 stars

Top 99.1% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

debug-gym is a Python framework for interactive debugging of codebases, targeting researchers and developers seeking to automate or augment the debugging process using Large Language Models (LLMs). It provides a text-based, Gymnasium-compatible environment that allows LLM agents to interact with code using tools like debuggers and code editors, aiming to identify and fix bugs automatically.

How It Works

The core of debug-gym is RepoEnv, a simulation environment that exposes a set of tools to LLM agents. These tools, such as listdir, view, eval, pdb, and rewrite, augment the agent's capabilities. Agents interact by taking observations and generating tool commands. The environment executes these commands, providing new observations, facilitating an iterative debugging loop. This modular tool design allows for extensibility and customization for various debugging scenarios.

Quick Start & Requirements

  • Install via pip: pip install debug-gym
  • Requires Python >= 3.12.
  • LLM configuration (API keys/credentials) is required via llm.yaml.
  • Note: Interactive terminal sessions (like pdb) are primarily supported on Linux due to PTY limitations on macOS/Windows.
  • Official Docs: Technical Report, Project Page

Highlighted Details

  • Integrates with popular benchmarks like Aider and SWE-bench.
  • Supports multiple LLM backends (OpenAI, Azure OpenAI, Anthropic).
  • Allows custom tool development and system prompt customization via Jinja templates.
  • Includes analysis scripts and a Flask app for log visualization.

Maintenance & Community

This project is from Microsoft. Contributions are welcome via a CLA. Further details on contributing and the Code of Conduct are available.

Licensing & Compatibility

The repository does not explicitly state a license in the README. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

Interactive terminal debugging (e.g., pdb) has limited support on non-Linux platforms (macOS, Windows). The solution_agent is currently benchmark-specific.

Health Check
Last commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
26
Issues (30d)
1
Star History
19 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.