Automated Fixes

AI-Powered Bug Fixing for Production APIs

Most error trackers stop at a stack trace. PatchFlow’s AI-powered bug fixing continues to a draft GitHub pull request: clone the repo, locate the route handler, write a framework-aware error path, check that it parses, and leave the merge decision to you.

FixAgent

Uses the stack or chaos finding to find the handler and generate an AST-oriented patch with the right framework imports.

ReviewAgent

Senior-style pass over the diff: syntax/AST checks and, on Pro and Team, pre-merge build verification before push.

GitHubAgent

Opens a draft PR on a consolidated branch with failure-mode context. Auth, billing, and credential files are never patched.

Automated issue resolution without auto-merge

“AI bug fixing” in PatchFlow means a scripted agent pipeline, not a chatbot in your IDE. Two product events can start it: a chaos scan finding, or a production fingerprint that crossed the threshold from the monitoring SDK. Both end at a draft PR. Automated resolution covers the patch proposal; you still own the merge.

The six-agent pipeline

On a chaos run the sequence is DiscoveryAgent → ChaosAgent → AnalystAgent → FixAgent → ReviewAgent → GitHubAgent. Production incidents skip discovery and injection; ingest and dedup replace those steps, then the same three agents write the PR.

FixAgent

Clones the connected GitHub repository, locates the route handler from the stack or endpoint, and writes a surgical change — typically try/except or equivalent, status-correct responses, and imports such as FastAPI HTTPException, Django JsonResponse, or Spring ResponseEntity.

ReviewAgent

Checks that the patch is structurally valid. On Developer Pro and Team, pre-merge build checks (TypeScript tsc, Node) run so obviously broken code is less likely to land in the PR. Hobby chaos scans can still open PRs; live SDK auto-patches and those build checks are Pro/Team features.

GitHubAgent

Pushes a consolidated branch and opens a draft pull request. The demo title shape is fix: 503 resilience on /api/v1/orders. GitHub scopes requested at login are repo, read:user, and user:email. Revoke anytime in GitHub settings.

Guardrails

  • Blocklist: auth, billing, payments, migrations, credentials, encryption, admin, and permission files are not auto-patched.
  • Temporary clone only; not used to train models (see privacy).
  • Three-occurrence gate on SDK incidents, configurable per account, so a one-off glitch does not open a PR.
  • After pr_opened, the same fingerprint waits until you close or merge before another run.

Use cases

Unhandled database errors on a read path

Chaos mode db_connection_drop or a live SQLAlchemyError both map to “this GET returns 500”. The generated patch wraps the fetch, logs the error, and raises 503 or 404 — the pattern shown on the homepage and demo diffs.

Malformed JSON from a dependency

If the handler assumes response.json() always works,malformed_json in a scan (or a real parse exception in production) is a candidate for an explicit 502/503 path instead of an uncaught exception.

Night-shift noise reduction

Email alerts still fire. The difference versus a tracker-only workflow is that the on-call engineer can open a PR that already names the endpoint and failure mode, then reject or amend it. PatchFlow does not claim it replaces review.

What it will not do

It will not invent product features, migrate schemas, or touch blocklisted security code. It will not run your full CI unless you add that in GitHub after the draft exists. Team plans mention custom CI checks in addition to the built-in compiler pass. For quota: Pro includes 100 live SDK auto-patches per month; Team is unlimited. Start from GitHub login or the demo if you want to see a completed run first.

Related PatchFlow pages

FAQ

Questions developers ask

Straight answers about how this part of PatchFlow actually works.

Does PatchFlow merge pull requests automatically?

No. GitHubAgent opens a draft pull request. You review, run your own tests, and merge. Pre-merge build checks (where the plan includes them) add a verification badge; they do not merge the branch.

What does “compiler-verified” mean here?

ReviewAgent checks AST structure (brackets and syntax) and, on plans that include it, runs language tooling such as the TypeScript compiler (tsc) and Node checks before the PR is opened. The intent is to avoid hallucinated imports and broken syntax — not to prove your full production test suite passed.

SDK and pipeline context

Is repository code used to train models?

PatchFlow clones the repo temporarily to generate and verify a fix, then removes that clone when the run finishes. The privacy policy states code is not kept as a permanent copy and is not used to train AI models.

Repository access policy
Start Free Today

See it on your own API.

Connect a GitHub repository to run a chaos scan, install the SDK for production errors, or walk through a sample run on the live demo — no account required.

  • Hobby plan is free
  • Draft PRs only — nothing auto-merges
  • FastAPI, Django, Express, Spring Boot, Flask