Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoPR — Agentic Code-Fix Agent

An autonomous agent that takes a GitHub issue, explores the target repository, proposes a code fix, verifies it by running the project's test suite inside a sandboxed Docker container, and opens a pull request only if the tests pass.

Unlike a single LLM call, this runs a plan → explore → edit → test → decide loop (built on LangGraph) and will retry its own patch if the tests fail, up to a configurable number of attempts.

Architecture

GitHub Issue URL
      |
      v
 [ plan ]  --  LLM reads the issue + repo file tree, decides which files matter
      |
      v
 [ explore ] -- reads the relevant files, builds context
      |
      v
 [ edit ]  --  LLM proposes a unified diff / file edit
      |
      v
 [ test ]  --  applies the patch in a Docker sandbox, runs the test suite
      |
      v
 [ decide ] -- tests pass?  --yes--> open PR via GitHub API
      |
      no --> back to [ edit ] (retry, up to MAX_ATTEMPTS)

Setup

python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env   # fill in ANTHROPIC_API_KEY and GITHUB_TOKEN

Usage

python -m src.cli --repo https://github.com/<owner>/<repo> --issue 42

Status

Early scaffold — graph structure, GitHub client, and Docker test runner are wired up. Next steps: flesh out the edit node's diff-generation prompt, add language auto-detection for the test runner, and add a dry-run mode.

Roadmap ideas (good follow-up commits)

  • Auto-detect test command from repo (package.json / Gemfile / pyproject.toml)
  • Post progress as PR/issue comments while the agent works
  • Add a "diff review" step where a second LLM call sanity-checks the patch before it's applied (agent-critiques-agent pattern)
  • Web UI to trigger runs and watch the agent's reasoning trace live

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages