Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Issue Resolver

GitHub Issue Resolver is an autonomous AI system that takes a GitHub issue URL, analyzes the problem, generates a fix, validates it with tests, and opens a pull request automatically.

The project is built with LangGraph and follows a multi-agent architecture where each agent focuses on a specific task. Together, they move from understanding the issue to delivering a tested solution with minimal manual effort.


How It Works

Issue URL → Researcher → Planner → Coder → Tester → PR Agent → Pull Request

Each agent shares information through a common state, while LangGraph handles the workflow and routing logic.

Agent Responsibility
Researcher Reads the issue, explores the repository, and identifies relevant files
Planner Analyzes the problem and creates a step-by-step plan for the fix
Coder Implements the solution and generates the required code changes
Tester Creates and runs tests inside an isolated environment
PR Agent Commits the changes and opens a pull request

Key Features

  • Automatically investigates the codebase to find relevant files and context
  • Performs root-cause analysis before attempting a fix
  • Generates and applies code patches based on the issue requirements
  • Detects and retries failed code generations when possible
  • Runs tests inside a Docker sandbox for safe execution
  • Supports resumable workflows using Redis checkpoints
  • Works with any OpenRouter-supported model, including free-tier options

Getting Started

Prerequisites

Before running the project, make sure you have:

  • Python 3.11+
  • Docker
  • Redis (optional, for checkpointing and resuming runs)
  • GitHub CLI (gh) installed and authenticated

Installation

git clone https://github.com/Waqas392/github-issue-resolver.git
cd github-issue-resolver
pip install -e ".[dev]"

Environment Setup

Create a .env file from the provided template:

cp .env.example .env

Then add your credentials:

GIR_OPENROUTER_API_KEY=sk-or-...
GIR_GITHUB_TOKEN=ghp_...
GIR_MODEL_NAME=openai/gpt-oss-20b:free

Running the Project

Run the complete workflow:

python main.py --issue https://github.com/owner/repo/issues/123

Generate the fix without creating a pull request:

python main.py --issue https://github.com/owner/repo/issues/123 --dry-run

Skip test execution:

python main.py --issue https://github.com/owner/repo/issues/123 --no-tests

Resume a previously interrupted run:

python main.py --issue https://github.com/owner/repo/issues/123 --resume <run-id>

Configuration

Variable Default Description
GIR_MODEL_NAME openai/gpt-oss-20b:free Model used through OpenRouter
GIR_MAX_RESEARCHER_FILES 3 Maximum files analyzed by the Researcher
GIR_MAX_FILE_SIZE_LINES 1000 File truncation limit
GIR_MAX_TOKENS_PER_CALL 1000 Maximum tokens per model request
GIR_GITHUB_DEFAULT_BASE_BRANCH main Base branch used when creating pull requests

Project Structure

github-issue-resolver/
├── src/
│   ├── agents/
│   │   ├── researcher.py
│   │   ├── planner.py
│   │   ├── coder.py
│   │   ├── tester.py
│   │   └── pr_agent.py
│   ├── tools/
│   │   └── github_tools.py
│   ├── config.py
│   └── orchestrator.py
├── main.py
├── .env.example
└── requirements.txt

Tech Stack

  • LangGraph for workflow orchestration
  • OpenRouter for model access
  • GitHub CLI for interacting with GitHub
  • Pydantic for structured configuration and validation
  • Docker for isolated test execution
  • Structlog for structured logging

Sample Run

✔ researcher    13.5s     Found validator.py and related files
✔ planner       33.5s     Identified incorrect validation logic
✔ coder         11.5s     Applied patch to validator.py
✔ tester        15.1s     All tests passed
✔ pr_agent      30.2s     Pull request created successfully

Why I Built This

I built this project to explore how autonomous AI agents can collaborate on real software engineering tasks. Rather than relying on a single model call, the system breaks the workflow into specialized agents responsible for research, planning, coding, testing, and pull request creation.

The project demonstrates how LangGraph can be used to build structured, multi-step AI workflows that interact with real development tools and repositories while maintaining clear responsibilities between agents.


License

MIT License.

About

Autonomous multi-agent system that resolves GitHub issues and opens PRs

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages