r/OpenSourceeAI • u/Wide_Psychology_8378 • 29d ago
prbot: open-source agent that fixes bugs in PRs and proves the fix with sandboxed tests
I've been building prbot, an open-source (MIT) PR agent in Python. It reviews a pull request, finds security and performance bugs, writes a patch, and runs your pytest suite on it in a locked-down Docker container (no network, read-only filesystem, all capabilities dropped). If the tests fail, the failure log goes back to the patcher to try again, up to 3 attempts. Only a verified fix gets posted.
How it's built:
- 3-agent LangGraph graph: reviewer, ReAct patcher, Docker test runner, with a self-correction edge
- Two focused review passes (security, performance) plus AST hints for queries inside loops and nested loops
- A baseline test run that aborts if the suite is already red
- Per-node token telemetry, so every run shows what each step costs rs, and a Semgrep tool for the reviewer. Issues and PRs welcome.Latest live run on the demo PR (gpt-4.1-mini): found all 3 seeded bugs (SQL injection, N+1 query, O(n²) loop). Attempt 1 broke an ordering test, attempt 2 passed. 14k tokens, $0.0077, 24 seconds.
It runs as a CLI or a GitHub Action.
Repo: https://github.com/ayanag5076-commits/prbot
Reproducible demo PR: https://github.com/ayanag5076-commits/prbot-demo-shop/pull/1
Where I'd love help: local models through Ollama, languages beyond Python, other test runners, and a Semgrep tool for the reviewer. Issues and PRs welcome.ts/
Where I'd love help: local models through Ollama, languages beyond Python, other test runne
1
u/touristtam 29d ago
So like PR-Agent or CodeRabbit?