Skip to main content

Auto-Fix PR Bugs Before Merge

Devin reviews every PR for bugs and pushes fixes to the branch automatically.
AuthorCognition
CategoryCode Quality
FeaturesIntegrations
1

Enroll repos and users for auto-review

Devin Review can automatically review every PR on your repositories — no manual triggering needed. Start by enrolling the repos and users you want covered.
  1. Go to Settings > Review in the Devin webapp
  2. Under Repositories, search for and add the repos you want Devin to auto-review (e.g., acme/frontend, acme/api-server)
  3. Under Users, add GitHub usernames whose PRs should always be reviewed — or any user can self-enroll by clicking “Add myself (@username)”
Once enrolled, Devin automatically reviews PRs when they’re opened, when new commits are pushed, or when a draft is marked ready for review.
Any team member with a connected GitHub account can self-enroll for auto-reviews — no admin permissions needed. Go to Settings > Review and click “Add myself”.
2

Enable Auto-Fix so Devin pushes fixes, not just comments

By default, Devin Review posts bug findings as inline comments. Auto-Fix goes further — Devin proposes code changes and can push fix commits directly to the PR branch.To enable it, go to Settings > Customization > Pull request settings > Autofix settings - bot comments and choose one of:
  • Respond to specific bots only — add devin-ai-integration[bot] to the allowlist (recommended)
  • Respond to all bot comments — Devin acts on all bot comments, not just its own
You can also toggle Auto-Fix per PR: open any Devin Review page, click the settings icon (three dots in the header), and enable “Enable Autofix”.
“Respond to all bot comments” can cause infinite loops if other bots also comment on Devin’s changes. Use the allowlist mode and add only devin-ai-integration[bot] to stay safe.
3

See what Devin catches and fixes

When a PR is opened on an enrolled repo, Devin Review runs automatically and produces:
  • Bug findings in the Analysis sidebar, labeled by severity (Severe or Non-severe) and confidence
  • Flags for patterns worth investigating but not necessarily wrong
  • Fix commits pushed directly to the PR branch for issues Devin can resolve (when Auto-Fix is on)
For example, on a PR that adds a new user settings page, Devin Review might find:
Bug (Severe): Null reference in UserSettings.tsx:38

`user.preferences.theme` throws if `preferences` is undefined,
which happens for accounts created before v2.3.

Fix pushed — commit e4a1b2c:
  const theme = user.preferences?.theme ?? 'system';
You can review each finding in the diff view, mark bugs as resolved, or ask follow-up questions using the built-in codebase-aware chat — Devin has context from the entire repo, not just the diff.
4

Teach Devin Review your team's standards

Devin Review reads AGENTS.md and REVIEW.md files in your repository to learn your team’s conventions. Use these files to define review preferences, common bug patterns to watch for, and coding standards you want enforced:
<!-- REVIEW.md -->
## Review guidelines

- All API route handlers in src/routes/* must validate request body
  with zod schemas before accessing properties. Flag any handler
  that reads req.body fields without validation.
- The useUnsafeEffect hook in src/hooks/useUnsafeEffect.ts is
  intentional — do not flag it as a missing-deps issue.
- Check for unhandled error cases in API calls.
- Ensure new database queries have appropriate indexes.
Commit this file to your repo and Devin Review will follow these guidelines on every PR. Update it as your team discovers new patterns — for example, after a production bug, add the pattern that would have caught it so Devin flags similar issues in future reviews.You can also use the Review chat on any PR to ask Devin to check for specific patterns across the diff — for instance, “Are there any API calls in this PR that don’t handle the error case?”