Repository navigation
feat(seer): Gate agent chat on Seer credits - #129563
Merged
billyvg merged 11 commits intoNov 9, 2026
Merged
Conversation
billyvg
force-pushed
the
billyvong/cw-2332-sentry-ui-gate-agent-chat-before-sending
branch
from
November 5, 2026 20:08
a781f45 to
b549aa9
Compare
billyvg
force-pushed
the
billyvong/cw-2321-sentry-ui-out-of-credits-cta-with-escalation
branch
from
November 5, 2026 20:08
b2159ac to
53361ad
Compare
Contributor
Story previewsPreview the stories changed in this PR on the Vercel deployment:
Preview deployment: https://sentry-cynav3bo0.sentry.dev |
billyvg
force-pushed
the
billyvong/cw-2332-sentry-ui-gate-agent-chat-before-sending
branch
from
November 5, 2026 20:33
b549aa9 to
60f9222
Compare
Contributor
Sentry Snapshot Testing
|
billyvg
force-pushed
the
billyvong/cw-2321-sentry-ui-out-of-credits-cta-with-escalation
branch
from
November 5, 2026 21:38
d009d44 to
dba69c6
Compare
billyvg
added a commit
that referenced
this pull request
Nov 5, 2026
…s CTA The story manifest loads MDX stories from gsApp, but knip only took gsApp's .stories.tsx files as entry points, so it reported seerOutOfCreditsNotice.stories.mdx as unused. SeerOutOfCreditsCta gets a temporary entry point until the credit gates in #129563 and #129565 render it, and getSeerOutOfCreditsMessage is only used in its own file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
billyvg
force-pushed
the
billyvong/cw-2332-sentry-ui-gate-agent-chat-before-sending
branch
from
November 5, 2026 21:49
6c3d73b to
5e11518
Compare
billyvg
force-pushed
the
billyvong/cw-2321-sentry-ui-out-of-credits-cta-with-escalation
branch
from
November 5, 2026 22:03
dba69c6 to
a43272f
Compare
billyvg
added a commit
that referenced
this pull request
Nov 5, 2026
…s CTA The story manifest loads MDX stories from gsApp, but knip only took gsApp's .stories.tsx files as entry points, so it reported seerOutOfCreditsNotice.stories.mdx as unused. SeerOutOfCreditsCta gets a temporary entry point until the credit gates in #129563 and #129565 render it, and getSeerOutOfCreditsMessage is only used in its own file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
billyvg
force-pushed
the
billyvong/cw-2332-sentry-ui-gate-agent-chat-before-sending
branch
from
November 5, 2026 22:06
5e11518 to
0b82f19
Compare
billyvg
force-pushed
the
billyvong/cw-2332-sentry-ui-gate-agent-chat-before-sending
branch
from
November 6, 2026 17:14
5c07c7a to
61f0c8d
Compare
billyvg
marked this pull request as ready for review
November 6, 2026 17:26
billyvg
force-pushed
the
billyvong/cw-2332-sentry-ui-gate-agent-chat-before-sending
branch
from
November 6, 2026 17:47
61f0c8d to
15ce1ca
Compare
srest2021
approved these changes
Nov 9, 2026
billyvg
commented
Nov 9, 2026
When the org can't afford another chat message, the Seer chat shows the out-of-credits CTA right above the composer and nothing sends: the send button and Enter, suggested questions, timeout retry, /investigate, the autofix embeds' chat actions, and questions forwarded from elsewhere, which wait in the composer instead. Typing stays enabled so the draft survives a top-up. The check only runs while the composer is on screen, and does nothing for orgs without seer-credit-checks. Fixes CW-2332 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Billing members of orgs with seer-credit-checks now see how much of the org's Seer credits is used, next to the chat's send button. Hovering shows the balance and the auto reload state, using the billing gates copy. The meter is a getsentry override slot. It renders nothing in open source, or when the wallet doesn't load. The out-of-credits alert above the composer now passes reason="agent-chat" to the reworked CTA. Refs CW-2332 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Credit checks also need token-billed-seer-enabled as of #129545, so the tests and stories that turn on seer-credit-checks turn it on too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
useSeerCreditCheck no longer exports hasSeerCreditChecks as of #129545, so the meter checks seer-credit-checks and token-billed-seer-enabled directly. Only token-billed orgs have a wallet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ates designs The Seer chat composer gets the designs' toolbar row under the editor, and the credit usage meter and send button move into it. The send button is the designs' small up arrow. The editor and toolbar share one border and one focus ring. The meter's bar is the designs' 50x10 pill on a bordered track, and its tooltip is 250px wide with a line's space between paragraphs. With auto reload off, the tooltip only counts the month's credits, as in the designs; the out-of-credits alert is where billing members turn auto reload on. Refs CW-2332 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A question forwarded into the chat waits for the first credit check, but the user's own sends went through in the meantime. One landing first left the session non-empty, so the forwarded question was dropped, sent after it, or replayed into the next new chat. While a forwarded question waits, the panel's other sends wait too: the composer, suggestions, retry, /investigate, and the autofix embeds. Refs CW-2332 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The app's query client turns refetch on window focus off by default, so after a top-up or spend in another tab the meter kept its old numbers while the chat's credit check updated. Its wallet and auto reload queries now refetch on focus too. Refs CW-2332 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Sofia Rest <68917129+srest2021@users.noreply.github.com>
InputSection's usageMeter prop renders whatever it gets in the toolbar under the editor, before the send button. toolbarItems says where it shows rather than what the chat happens to put there today. Refs CW-2332 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The out-of-reloads tooltip link now reads "Configure auto-reload.", so the test finds it by that name and the story describes where it goes. Refs CW-2332 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
billyvg
force-pushed
the
billyvong/cw-2332-sentry-ui-gate-agent-chat-before-sending
branch
from
November 9, 2026 18:48
deb6206 to
1eb7886
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1eb7886. Configure here.
…rward Each forwarded question remounts the chat, but React Query keeps the previous panel's credit-check answer. The check isn't pending while that cached answer exists, so a forwarded question acted on it. If it said the org was out of credits but someone had topped up since, the question was parked in the composer and never sent. useSeerCreditCheck now also returns hasCheckedSinceMount, which only turns true once the check answers or fails after the caller mounted. The chat waits on it instead of isPending. Later window-focus refetches don't hold sends again. Refs CW-2332 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
billyvg
deleted the
billyvong/cw-2332-sentry-ui-gate-agent-chat-before-sending
branch
November 9, 2026 19:32
srest2021
added a commit
that referenced
this pull request
Nov 9, 2026
…tion (#130463) relates to CW-2332 depends on #129563, #130283, #130284 The chat's credit check only runs when the panel opens or the window regains focus. If credits run out partway through a conversation, the message box stays enabled and the next send fails with a generic error. This rechecks credits when: - Seer stops a reply for credits (`failure_reason: out_of_credits`) - a send comes back 402 so the out-of-credits notice and disabled message box show right away. A 402 no longer shows "There was an error sending your message"; the recheck brings up the notice instead. The recheck invalidates the credit check query, like `useExplorerAutofix` does. That needed `useSeerCreditCheck` to turn off with `enabled` instead of `skipToken`, so the key is the same either way. Example (it would show any intermediate thinking as well): <img width="402" height="615" alt="× Seer Agent I" src="https://github.com/user-attachments/assets/c7e056e8-73a7-4a5a-be32-62bcb80e1609" /> --------- Co-authored-by: Billy Vong <billy@sentry.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
srest2021
added a commit
that referenced
this pull request
Nov 11, 2026
…ling access (#130803) Problem: The credit usage meter next to the send button in the Seer chat only rendered for members with `org:billing` (#129563). The designs show it to every member, and every member can already read the wallet (`GET /customers/{org}/seer-wallet/` uses `RelaxedBillingPermission`). This PR: Show the meter to all members of orgs that have `seer-credit-checks` and `token-billed-seer-enabled`. Members without billing access see: - the percent bar, with the same warning color rules - "Your organization has used X% of your available credits." (no "monthly" since we don't have permission to know if autoload is on or not) - "{remaining}/{total} credits remaining." - no auto reload line and no "Configure auto-reload." link. No UI change for members with billing access. Before: <img width="419" height="300" alt="image" src="https://github.com/user-attachments/assets/91817863-2c7e-4714-b9cd-4278b6238d9f" /> After: <img width="419" height="300" alt="image" src="https://github.com/user-attachments/assets/b9492b99-aab8-411e-ab87-7bafc5c3ee6f" /> <!-- junior-request-attribution:start --> via **sofia**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AD0B1UK2PQKS%3A1794419917.134109 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AD0B1UK2PQKS%3A1794419917.134109) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0B1UK2PQKS%3A1794419917.134109/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Sofia Rest <sofia.rest@sentry.io>
This branch was successfully 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.

When the org can't afford another Seer chat message, the Seer Explorer chat (drawer, sidebar and popped-out window) shows the out-of-credits alert (
SeerOutOfCreditsCta reason="agent-chat") directly above the composer, and nothing in the panel can send a message. That covers the send button, Enter, the suggested questions (hidden), Retry after a timeout (disabled),/investigate, and the "Continue" / "Draft a pull request" / "Try again" buttons in autofix embeds inside the chat. Those buttons go disabled because the chat stops passing them its send function, the same way it already does for read-only chats. Typing stays enabled so a draft isn't lost. A question forwarded into the chat from elsewhere (Ask Seer, the autofix hand-off, the command palette) waits for the credit check, and if there are no credits it stays in the composer unsent.The composer now follows the Billing Gates designs: a toolbar row under the text field holds the send button, which is the designs' small up arrow, and the field and toolbar share one border and one focus ring. This applies to every Seer Explorer chat, not only orgs with credit checks.
Billing members also get a credit usage meter in that toolbar, next to the send button: the percent of the org's Seer credits used and a small bar. Hovering it shows how much is used and "{remaining}/{total} credits remaining." With auto reload off, the tooltip counts the month's credits and stops there, as in the designs. With auto reload on, it counts all available credits and adds one line:
The bar turns warning-colored at 90% used, and whenever the org can't afford a message. The meter is a new
component:seer-credit-usage-meterslot that renders nothing in open source. getsentry's implementation reads the Seer wallet and the auto top-up settings, and renders nothing until both load. Orgs without token-billed Seer get a 404 from the wallet, so they see no meter.Decisions the spec didn't settle:
org:billingdon't see the meter. The spec only has billing copy, and members can't act on its links.The credit check uses the
agent_chat_messageoperation and only runs while the composer is on screen. It does not run for someone else's read-only chat, for a chat that failed to load, or while a question or approval bar takes the composer's place. Withoutseer-credit-checksnothing changes, including the meter. While the first check is still loading, the user's own sends go through, because the hook fails open. The exception is a forwarded question: it waits for the result, and until it goes out the panel's other sends wait too, so it isn't dropped or sent second.Not gated here, for review:
dashboardEditSeerChat,createFromSeer) and the Ask Seer search combobox.Builds on #129545 (credit-check hook) and #129551 (out-of-credits CTA), which have both merged.
Fixes CW-2332
🤖 Generated with Claude Code