AI-powered GitHub issue solver that automatically discovers bugs, generates patches, and creates pull requests.
- π Automatic Issue Discovery - Scans repositories and triages issues by likelihood of automated fix
- π οΈ AI Patch Generation - Uses Gemini AI to generate code patches with validation
- π Iterative Repair - Self-improving patches through validation feedback loops
- π Confidence Scoring - Risk assessment (0-100) for each generated patch
- π― Draft PR Creation - Automatically creates PRs with AI disclosure and review checklist
- β‘ GitHub Actions - Full CI/CD integration for automated workflows
- π₯οΈ Interactive CLI - Beautiful terminal UI for patch review and approval
git clone https://github.com/CodeRustyPro/openfix.git
cd openfix
pip install -r requirements.txt
export GEMINI_API_KEY="your-gemini-api-key"
export GITHUB_TOKEN="your-github-token"# 1. Discover issues in a repository
python agents/discovery/discover_issues.py https://github.com/owner/repo
# 2. Generate a patch for a specific issue (interactive)
python scripts/cli.py solve https://github.com/owner/repo --issue 123
# 3. Full automation (discover + patch + PR)
python scripts/automate_full_pipeline.py \\
--repo-url https://github.com/owner/repo \\
--create-prDiscover Issues:
python scripts/cli.py discover https://github.com/owner/repo --limit 10Solve with Approval:
python scripts/cli.py solve https://github.com/owner/repo --issue 42
# Shows confidence score, diff preview, asks for approvalAuto-Approve (CI mode):
python scripts/cli.py solve https://github.com/owner/repo --issue 42 --no-confirmCheck Status:
python scripts/cli.py statusAdd .github/workflows/openfix.yml:
name: OpenFix
on:
issues:
types: [labeled]
jobs:
fix:
if: contains(github.event.issue.labels.*.name, 'openfix')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: CodeRustyPro/openfix-action@v1
with:
gemini-api-key: \${{ secrets.GEMINI_API_KEY }}
github-token: \${{ secrets.GITHUB_TOKEN }}Label any issue with openfix and the bot automatically generates a fix!
GEMINI_API_KEY- Required for AI patch generationGITHUB_TOKEN- Required for PR creation, optional for read-only operations
Edit config/config.yml:
llm:
model: "gemini-2.0-flash-exp"
temperature: 0.3
max_retries: 2
validation:
enabled: true
timeout: 300
patch:
max_files: 5
confidence_threshold: 60OpenFix calculates a 0-100 confidence score for each patch:
| Score | Risk | Recommendation |
|---|---|---|
| 75-100 | Low | High confidence - Consider auto-merge |
| 50-74 | Medium | Review recommended |
| 0-49 | High | Manual review required |
Scoring Factors:
- Triage Priority (25%)
- Issue Complexity (20%)
- Validation Results (35%)
- Repair Iterations (20%)
# Create test repository
python scripts/setup_sandbox.py
# Follow instructions to create GitHub repo
# Then test OpenFix on it# Unit tests
pytest tests/unit/
# Full test suite
pytest tests/ -v --cov=.- β Draft PRs Only - Never auto-merges
- β AI Disclosure - Clear attribution in every PR
- β Review Checklist - Ensures human oversight
- β Risk Labeling - High-risk patches clearly marked
- β Validation - Automated testing before PR creation
OpenFix Pipeline:
βββββββββββββββ
β Discover β β Scan repo for issues
ββββββββ¬βββββββ
β
ββββββββΌβββββββ
β Triage β β Filter & rank by suitability
ββββββββ¬βββββββ
β
ββββββββΌβββββββ
β Generate β β AI creates patch
ββββββββ¬βββββββ
β
ββββββββΌβββββββ
β Validate β β Run tests & checks
ββββββββ¬βββββββ
β
ββββββββΌβββββββ
β Repair β β Refine based on feedback
ββββββββ¬βββββββ
β
ββββββββΌβββββββ
β Create PR β β Draft PR with disclosure
βββββββββββββββ
We welcome contributions! See CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Powered by Google Gemini AI
- Built with PyGithub
- UI by Rich
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: devshah3@illinois.edu
Made with β€οΈ by CodeRustyPro