Repository navigation
feat(cli): Tell users when Seer is out of credits - #2150
Merged
Merged
Conversation
issue explain and issue plan now say the organization is out of Seer credits when Sentry answers 402 with code seer_out_of_credits, or when a run stops with failure_reason out_of_credits. Before, the 402 read as "Seer requires a paid plan" with a free trial offer, and a stopped run read as an analysis with no results. Fixes CW-3075
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
BYK
approved these changes
Nov 11, 2026
Nothing failed if the commands stopped passing the 402 code to the Seer error mapping. issue explain and issue plan now have a test for a 402 with seer_out_of_credits, and the API client test checks the code reaches the ApiError. The trial tests mock isatty, so they can assert that no_budget and not_enabled offer a trial in a terminal and out_of_credits does not. Refs CW-3075
The message told users to turn on auto-reload. An org with auto-reload on can still run out once it hits its daily usage limit, and Sentry does not say which case applies. The advice now covers both. Refs CW-3075
jaydgoss
marked this pull request as ready for review
November 11, 2026 17:07
sentry-junior Bot
added a commit
that referenced
this pull request
Nov 11, 2026
A 402 doesn't say whether auto-reload is off or the Seer spend limit was hit, so "turn on auto-reload" is wrong when it's already on. Use the same "adjust Seer spend and auto-reload" copy as #2150. Co-Authored-By: Sofia Rest <sofia.rest@sentry.io>
srest2021
approved these changes
Nov 11, 2026
vaind
added a commit
that referenced
this pull request
Nov 13, 2026
Fixes CW-3094 `analyze_issue_with_seer` returns an issue's existing run as soon as it has finished, and that includes failed runs. A run that stopped because the org ran out of Seer credits keeps coming back as the result, so it can't be retried after someone tops up. Follow-up to #2031, from [this review thread](#2031 (comment)). The tool now starts a new run whenever the last one ended in `error`, whatever the reason, matching the CLI (#2150). Completed and waiting-for-input runs are still returned as they are. If the org is still out of credits, the new start gets a 402, which the tool already explains as "Analysis Not Started". It now also shows whatever the failed run found before it stopped, such as a root cause. Tested manually against sentry.io with the local stdio server. On an issue whose last run had failed, the tool started a new run and returned its root cause, and the issue's latest run is now the completed one. The 402 path is covered only by unit tests, since it needs an org that's out of credits. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sentry issue explainandsentry issue plantreat every 402 from the autofix endpoint as "Seer requires a paid plan" and offer a free trial. An org on token-based billing that runs out of Seer credits gets that message too. A run that starts and then stops for credits reads as "Analysis completed but no root causes found" or "Plan creation failed".code: "seer_out_of_credits"(added in feat(seer-billing): Handle SeerOutOfCreditsException at Autofix callers sentry#130284) now raises a newout_of_creditsSeer error. Any other 402, includingseer_out_of_quotaand the 402 with no code that older Sentry versions send, keeps the current no-budget error.failure_reason: "out_of_credits"raises the same error from both commands.What the user sees:
A failed run is still retried on the next invocation, so someone who topped up recovers by running the command again.
The 402 comes from getsentry/sentry#130283 and getsentry/sentry#130284, which have both merged. Sentry's credit checks are behind the
organizations:seer-credit-checksflag, so for an org without it the CLI behaves as it does today. The MCP equivalent is #2031.Fixes CW-3075