Skip to content

Use @sentry/api types for Seer Autofix 402/409 error codes #2234

Open

Description

@sentry-junior

Follow-up from #2207 (#2207 (comment)).

The CLI and MCP hardcode the error codes that Sentry returns when it refuses to start a Seer Autofix run. They have to, because the endpoint's OpenAPI schema didn't declare those responses: @sentry/api 1.83.0 types StartOrganizationIssueAutofixErrors as only 400/401/403/404, each with an unknown body.

getsentry/sentry#131067 documents them:

  • 402 AutofixPaymentRequiredResponse: code is one of seer_out_of_credits or seer_out_of_quota (required).
  • 409 AutofixConflictResponse: code is optionally one of scm_integration_required, repos_not_linked or run_in_flight, with optional run_id / sentry_run_id.

Once a @sentry/api release includes that schema:

  • Bump @sentry/api.
  • CLI: derive OUT_OF_CREDITS_CODE and SETUP_REQUIRED_REASONS in packages/cli/src/lib/formatters/seer.ts from the generated error types, and narrow SeerErrorReason in packages/cli/src/lib/errors.ts against them.
  • MCP: derive the seer_out_of_credits check and the setup-required code list in packages/mcp-core/src/internal/tool-helpers/seer.ts from the same types.
  • Consider handling seer_out_of_quota too. Today it gets no special handling.

Blocked on getsentry/sentry#131067 merging and the schema sync publishing a new @sentry/api.

via @BYK.

--

View Session [Sentry]

Activity

  1. linear-code commented on Nov 13, 2026

    @linear-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions