Skip to content

feat(seer): Return denialReason on out-of-credits 402s - #131169

Merged
wedamija merged 7 commits into
masterfrom
danf/seer-credit-denial-reason
Nov 16, 2026
Merged

wedamija merged 7 commits into
masterfrom
danf/seer-credit-denial-reason

Conversation

@wedamija

@wedamija wedamija commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Part of the Seer token-based billing work. Before a Seer operation starts we ask billing whether the org has enough credits for it.

When the check fails, billing tells us whether the org is out of credits or hit its daily cap, but we threw that away. This adds it to the 402 as denialReason so the MCP and CLI can show the right message.

Refs CW-3100

@linear-code

linear-code Bot commented Nov 14, 2026

Copy link
Copy Markdown

CW-3100

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 14, 2026
@wedamija
wedamija marked this pull request as ready for review November 16, 2026 18:44
@wedamija
wedamija requested review from a team as code owners November 16, 2026 18:44
@wedamija
wedamija requested review from srest2021 and removed request for a team November 16, 2026 18:44
This PR was stacked on the credit check labels PR, which is on hold. Drop
those commits so the denial reason change can go in on its own.

Refs CW-3100
@wedamija
wedamija changed the base branch from danf/seer-credit-check-labels to master November 16, 2026 19:10
@wedamija
wedamija merged commit 0645006 into master Nov 16, 2026
71 checks passed
@wedamija
wedamija deleted the danf/seer-credit-denial-reason branch November 16, 2026 19:23
billyvg added a commit that referenced this pull request Nov 16, 2026
A 402 from the autofix endpoint now carries `denialReason` (#131169). The
toasts for a refused step or PR always said the organization was out of
credits, even when it had hit its daily usage limit. They now read
`denialReason` and say so for `daily_cap_exceeded`. Without a reason,
including from backends that predate it, they still say out of credits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
BYK pushed a commit to getsentry/toolkit that referenced this pull request Nov 16, 2026
Part of the Seer token-based billing work. Before a Seer operation
starts we ask billing whether the org has enough credits for it.

Sentry now tells us why the credit check failed
(getsentry/sentry#131169). If the org hit its daily spend limit we were
still saying they're out of credits, which sends people to buy more when
they just need to raise the limit or wait a day. This adds a message for
that case in the MCP and the CLI.

The CLI exit code is still 43.

Refs CW-3100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants