GuidesGuide · Autonomous engineering

AI that drafts pull requests from your error reports

By Doğan Turan, Co-founder, Qualia8 min read

TL;DR. When an error fires in production (Sentry, Rollbar, log aggregator), most teams triage manually: read the stack trace, find the file, understand the context, write the fix, open the PR. An AI teammate that does all of this automatically and hands you a reviewable PR instead of an alert cuts your bug backlog dramatically. In 2026, three options offer this: Qualia (portfolio scope, one AI teammate across all products), Viktor (as part of its engineer role), and DIY setups on Cursor or Claude Code plus custom automation.

The workflow you're actually paying for.

Manual bug triage in 2026 looks like this:

  1. Sentry alert fires.
  2. Someone gets the notification (waits until morning if off-hours).
  3. Engineer opens Sentry, reads the stack trace, opens the codebase.
  4. Reads surrounding code to understand what's happening.
  5. If the fix is obvious, writes it.
  6. If not, opens Slack to find who touched this file last.
  7. Opens a PR with context.
  8. Merge.

Best case: 30 minutes per error. Realistic case for a portfolio operator: 2 hours per error, because "opens the codebase" involves loading context on a product you haven't looked at in weeks.

For 15 products with dozens of errors per day, this is a full-time role. Or it's a backlog that grows every week.

What an AI teammate does instead.

  1. Sentry alert fires.
  2. The AI teammate reads the alert, stack trace, surrounding code, git blame, recent commits, and Slack context.
  3. Determines: real bug or noise? (Filters flaky tests, third-party API blips, known duplicates.)
  4. If it's a real bug: drafts the fix, opens a PR against the right branch, adds context to the PR description, tags the reviewer.
  5. Engineer reviews (usually 5 to 20 lines), approves or edits.
  6. Merge.

Time savings: 90% for simple fixes, 60% for complex fixes.

At portfolio scale, this is the difference between "we have dedicated bug triage" and "we ship the fixes as they come in." See autonomous operations for the wider pattern.

What to look for in an AI that drafts PRs.

  • 1. Reads the actual code, not just the error. Products that only see the error message produce hallucinated fixes.
  • 2. Reads git history. Who touched this file last? Products without git awareness re-introduce bugs already fixed.
  • 3. Uses your team's PR patterns. Descriptive commit messages, tests where required.
  • 4. Filters noise. Not every alert is a real bug.
  • 5. Portfolio-aware, not repo-aware. For a single product, any coding AI (Cursor, Claude Code, Codex) works. For a portfolio of 5+ products, the AI needs to understand which product, which repo, which team.
  • 6. Handles false-positive PRs gracefully. Closing wrong PRs should be one click.

Products that do this in 2026.

Qualia

Portfolio-scope AI teammate. Reads Sentry across all your products and drafts PRs against the right repos. Built for teams of 2 to 10 people running 3 to 20 products.

Viktor

Part of its "engineer" AI employee role. Strongest for teams that want one named AI engineer per team. Not portfolio-scope. See Qualia vs Viktor.

Cursor / Claude Code plus custom automation

DIY setup. Works if you have engineering time to build it.

Sentry AI Autofix

Sentry's own beta. Limited to Sentry, tied to that product's roadmap.

GitHub Copilot Workspace

Good for suggested fixes; requires a human to initiate. Not autonomous.

Devin / Cognition

General-purpose autonomous coding agent. Overkill for most PR-drafting workflows.

How to evaluate before you commit.

  • Step 1. Pick 10 real Sentry errors from the last 30 days. Mix simple and complex.
  • Step 2. Feed each to the AI teammate. Ask it to draft a PR.
  • Step 3. Rate each PR: correctness, completeness, convention, context.
  • Step 4. Compare across products. A product that gets 8 of 10 right and handles the other 2 gracefully is better than one that gets 10 of 10 right on simple errors but hallucinates on complex ones.

Common mistakes.

  • Deploying without a review gate. Never let AI-drafted PRs auto-merge.
  • Not connecting the AI to git history. An AI that only sees the error re-introduces already-fixed bugs.
  • Filtering too aggressively. "Only real bugs" misses edge cases. "Everything" is noise. Iterate for 2 weeks.
  • Assuming portfolio scope from a repo-scope product. Single-repo tools (Cursor, Copilot) don't natively handle "which product, which repo."

Keep reading.

Frequently asked questions.

Short answers to what people ask most. For anything else, ask the team at the bottom of the list.

  • For simple fixes (null checks, type coercion, missing imports), yes. For complex fixes, the AI should flag uncertainty rather than produce confident wrong fixes.

  • Yes. Most portfolio operators use Cursor for interactive coding and an AI teammate for autonomous triage.

  • Configure the filter to only trigger above a threshold. Iterate weekly.

  • No. It replaces engineer time spent on triage.

  • Portfolio-priced products include this as one capability. Dedicated bug-fixing products price per-fix or per-repo.

  • A single-repo tool might be enough. Portfolio scope matters at 3+ products.

  • Days for first PRs. Weeks for filter calibration. Months for the feedback loop to make it consistently better than a mid-level engineer at triage.

Got a problem in mind?

Consider it done.

Book a demo