Building Auto-Patch Agent: From Production Incident to Reviewed Code Fix
Production incidents require investigation, debugging, code changes, review, and deployment. I built Auto-Patch Agent to automate this workflow while keeping the code change reviewable.
What does Auto-Patch Agent do?
Auto-Patch Agent is an AI-powered incident response agent.
Given a production failure such as an HTTP 500 error, the agent:
- Investigates the repository
- Finds the root cause
- Proposes a targeted fix
- Creates a GitHub Pull Request
- Gets the change reviewed by Qodo
- Merges the fix after review
The Demo
I created a vulnerable Node.js order service for the demonstration.
An invalid customer ID caused the customer lookup to return undefined. The application then tried to access customer.id, resulting in an HTTP 500 error.
The agent investigated the repository and identified the failure path.
It then added validation and improved the error handling so an invalid customer request is handled properly instead of causing an unexpected server error.
The change was committed to a separate branch and submitted as a Pull Request.
How I Used TrueForge
TrueForge is the runtime and orchestration layer for the agent.
I used TrueForge to:
- Run the AI agent
- Connect Gemini as the model
- Connect development and repository tools
- Handle agent tool calls
- Give the agent access to the project for investigation
This makes the project more than an LLM generating code. The agent interacts with the development workflow.
How I Used Qodo
Qodo provides an independent code review layer.
After the fix was submitted as a Pull Request, Qodo reviewed the changes for bugs and code quality issues.
The review helped validate the remediation before merging.
The final review reported 0 bugs found, and the Pull Request was merged into main.
Workflow
Incident
↓
Repository Investigation
↓
Root Cause
↓
Targeted Fix
↓
GitHub Pull Request
↓
Qodo Review
↓
0 Bugs Found
↓
Merge
Tech Stack
- TrueForge
- Gemini
- GitHub
- GitHub MCP
- Qodo
- Node.js
- Express.js
Why I Built It
The goal was to connect an AI model to a real engineering workflow.
Instead of only asking AI for a code suggestion, Auto-Patch Agent investigates the repository, creates a targeted remediation, submits it through GitHub, and gets the change independently reviewed by Qodo.
The final merge remains controlled and reviewable.
This project shows how AI agents can assist with practical incident response and software maintenance.
Top comments (0)