Skip to main content

Overview

The Sentry issue-fix tool lets you point OpenSRE at a Sentry issue and have the Pi coding agent propose a fix. OpenSRE fetches the issue context, runs Pi in your current repository, and returns a summary plus the git diff. By default it only edits the working tree so you can review the diff. When you ask it to open_pr (and enable the ship switch), it also commits the fix to a fresh branch, pushes it, and opens a pull request — it never pushes to your base/main branch. This is a tool page, not a full integration setup page. It depends on the Sentry integration plus local Pi and opt-in env gates.
This is a mutating tool — it changes files on disk and can open a PR. It is disabled by default: the fix step needs PI_ISSUE_FIX_ENABLED=1, Sentry configured, and the Pi CLI installed. Opening a PR needs a second switch, PI_ISSUE_FIX_SHIP_ENABLED=1, plus a GitHub token. Enable each deliberately.

Prerequisites

  • Sentry configured (org + auth token) — see Sentry
  • Pi coding agent CLI installed and authenticated
  • PI_ISSUE_FIX_ENABLED=1 to allow the fix step
  • For PRs: PI_ISSUE_FIX_SHIP_ENABLED=1 and GITHUB_TOKEN / GH_TOKEN with repo / pull_request write access

Setup

  1. Configure Sentry and install Pi:
  1. Turn the tool on:
  1. (Optional) Allow OpenSRE to open a pull request:

Credentials

Your Sentry token is never sent to Pi. OpenSRE builds a short masked task (title, error, culprit, location) for the coding agent.

Investigation tools

Using it from the interactive shell

Once enabled, ask in plain language in opensre:
Say “open a pull request” (or “ship it”) to open a PR; leave it out to get the diff only. Use a fix verb — “investigate” / “diagnose” routes to the read-only investigation pipeline instead.

Verify

  1. opensre integrations verify sentry — Sentry REST config works
  2. Pi CLI available on PATH
  3. Env gates set (PI_ISSUE_FIX_ENABLED=1, and ship env if you need PRs)

Troubleshooting

Security

  • Dual opt-in by design: fix and ship are separate switches, both off by default.
  • OpenSRE never commits to or force-pushes your base/main branch.
  • Sentry tokens stay on the OpenSRE side; Pi receives masked issue context only.
  • Review the diff before merging any PR.

Extras

How it works

  1. You paste a Sentry issue URL and ask OpenSRE to fix it.
  2. OpenSRE resolves the issue and builds a short, masked task for Pi.
  3. Pi edits the current repository to implement the fix.
  4. You get success, a summary, changed_files, and the diff.
  5. If you asked for open_pr (and shipping is enabled), OpenSRE commits to a fresh opensre/sentry-fix-<id>-<sha> branch, pushes it, opens a PR into your base branch, and returns branch_name, pr_url, and pr_number.

Opening a pull request

  • The fix always lands on a new namespaced branch and is proposed via PR.
  • The PR body links the Sentry issue and lists changed files.
  • If the fix succeeds but the PR cannot be opened, you still get the diff.

Supported URLs

  • https://<org>.sentry.io/issues/<id>/
  • https://sentry.io/organizations/<org>/issues/<id>/
  • Self-hosted https://sentry.<company>.com/organizations/<org>/issues/<id>/

Notes

  • Without open_pr, nothing is committed or pushed.
  • Failures return a clear error_kind instead of silently doing the wrong thing.