Home › AI that drafts PRs from errors
Guide · Autonomous engineering
AI that drafts pull requests from your error reports
The workflow you're actually paying for.
Manual bug triage in 2026 looks like this:
- Sentry alert fires.
- Someone gets the notification (waits until morning if off-hours).
- Engineer opens Sentry, reads the stack trace, opens the codebase.
- Reads surrounding code to understand what's happening.
- If the fix is obvious, writes it.
- If not, opens Slack to find who touched this file last.
- Opens a PR with context.
- 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.
- Sentry alert fires.
- The AI teammate reads the alert, stack trace, surrounding code, git blame, recent commits, and Slack context.
- Determines: real bug or noise? (Filters flaky tests, third-party API blips, known duplicates.)
- 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.
- Engineer reviews (usually 5 to 20 lines), approves or edits.
- 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."
Frequently asked questions.
Does the AI actually write good fixes?
For simple fixes (null checks, type coercion, missing imports), yes. For complex fixes, the AI should flag uncertainty rather than produce confident wrong fixes.
Can I use this alongside Cursor or Claude Code?
Yes. Most portfolio operators use Cursor for interactive coding and an AI teammate for autonomous triage.
What if the AI opens too many PRs?
Configure the filter to only trigger above a threshold. Iterate weekly.
Does this replace engineers?
No. It replaces engineer time spent on triage.
How much does this cost?
Portfolio-priced products include this as one capability. Dedicated bug-fixing products price per-fix or per-repo.
What if I only have one product?
A single-repo tool might be enough. Portfolio scope matters at 3+ products.
How long before it's useful?
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.