Repository navigation
feat(notifications): Add out-of-credits notifications for Seer Autofix and Agent - #130500
alexsohn1126 wants to merge 11 commits into
Conversation
| # TODO(alexsohn): change this to top-up or request credits link | ||
| billing_url = organization.absolute_url( | ||
| f"/settings/{organization.slug}/billing/overview/" | ||
| ) |
There was a problem hiding this comment.
will update this once the request top-up/request credits page has been implemented, as well as the button text below.
There was a problem hiding this comment.
Would this be for people with or without billing permission? For billing permission users, the top up modal can be opened from the billing overview you've linked; for regular members, we can call this auto-reload request endpoint: https://github.com/getsentry/getsentry/blob/master/getsentry/api/seer_top_up_request.py
and maybe change the button copy accordingly
There was a problem hiding this comment.
Ah right, I'll need to make some changes in the template so we can render different copies based on who triggered the action. Thanks!
|
bugbot review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 49e0592. Configure here.
19ea9a1 to
6e36b0a
Compare
Sentry Snapshot Testing
|
Adds SeerAutofixOutOfCredits with its template, notification source and Slack rendering, and a has_credits_for_next_step flag on SeerAutofixUpdate that hides the next-step button when it is False. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds SeerAgentOutOfCredits with its template, notification source and Slack rendering. The PR status line under an agent answer now says the org is out of Seer credits when a push failed for that reason. Moves the OUT_OF_CREDITS constant here so the renderer can use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a "Manage Seer credits" button to the Autofix and Agent out-of-credits messages. There is no top-up or request-credits page yet, so it opens the billing overview, where billing members can set up auto top up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use the product copy for the Autofix and Agent out-of-credits messages, and label the billing button "Configure autoreload". Autofix now has separate copy for a run that could not start and one that ran out of credits partway through. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Drop has_credits_for_next_step from the autofix update. The next-step button is shown whether or not the org has Seer credits; a step that can't run fails in Seer and the thread gets the out-of-credits reply. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…fication Nothing sends the "start an Autofix run" copy, so remove the started attribute, the message property and the unused constant. The notification always renders the one out-of-credits message. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
6e36b0a to
3077054
Compare
| # TODO(alexsohn): change this to top-up or request credits link | ||
| billing_url = organization.absolute_url( | ||
| f"/settings/{organization.slug}/billing/overview/" | ||
| ) |
There was a problem hiding this comment.
I guess we need to add a hardlink to the auto reload modal?
There was a problem hiding this comment.
yea that would be great!
| ActionsBlock( | ||
| elements=[ | ||
| LinkButtonElement( | ||
| text="Configure autoreload", |
There was a problem hiding this comment.
| text="Configure autoreload", | |
| text="Configure auto-reload", |
| ) | ||
|
|
||
|
|
||
| AUTOFIX_OUT_OF_CREDITS_MESSAGE = "Your org does not have enough credits to continue your Autofix run. Set up auto top up to keep your flow uninterrupted." |
There was a problem hiding this comment.
| AUTOFIX_OUT_OF_CREDITS_MESSAGE = "Your org does not have enough credits to continue your Autofix run. Set up auto top up to keep your flow uninterrupted." | |
| AUTOFIX_OUT_OF_CREDITS_MESSAGE = "Your organization does not have enough credits to continue your Autofix run. Set up auto-reload to keep your flow uninterrupted." |
| ) | ||
|
|
||
|
|
||
| AGENT_OUT_OF_CREDITS_MESSAGE = "Your organization does not have enough credits left for you to message Seer, and you have no auto top-ups remaining. Adjust your spend and turn on auto top-up." |
There was a problem hiding this comment.
| AGENT_OUT_OF_CREDITS_MESSAGE = "Your organization does not have enough credits left for you to message Seer, and you have no auto top-ups remaining. Adjust your spend and turn on auto top-up." | |
| AGENT_OUT_OF_CREDITS_MESSAGE = "Your organization does not have enough credits left for you to message Seer, and you have no auto-reloads remaining. Adjust your spend and turn on auto-reload." |
| ) | ||
|
|
||
|
|
||
| AUTOFIX_OUT_OF_CREDITS_MESSAGE = "Your org does not have enough credits to continue your Autofix run. Set up auto top up to keep your flow uninterrupted." |
There was a problem hiding this comment.
| AUTOFIX_OUT_OF_CREDITS_MESSAGE = "Your org does not have enough credits to continue your Autofix run. Set up auto top up to keep your flow uninterrupted." | |
| AUTOFIX_OUT_OF_CREDITS_MESSAGE = "Your organization does not have enough credits to continue your Autofix run. Set up auto-reload to keep your flow uninterrupted." |
| ) | ||
|
|
||
|
|
||
| AGENT_OUT_OF_CREDITS_MESSAGE = "Your organization does not have enough credits left for you to message Seer, and you have no auto top-ups remaining. Adjust your spend and turn on auto top-up." |
There was a problem hiding this comment.
| AGENT_OUT_OF_CREDITS_MESSAGE = "Your organization does not have enough credits left for you to message Seer, and you have no auto top-ups remaining. Adjust your spend and turn on auto top-up." | |
| AGENT_OUT_OF_CREDITS_MESSAGE = "Your organization does not have enough credits left for you to message Seer, and you have no auto-reloads remaining. Adjust your spend and turn on auto-reload." |
For "no auto-reloads remaining" I'd keep an eye on this thread for the final decision: https://sentry.slack.com/archives/C0CE9U55PK4/p1794509774356859?thread_ts=1794508482.066299&cid=C0CE9U55PK4
Apply the copy suggestions from review: say "auto-reload" instead of "auto top-up" and "autoreload", and "organization" instead of "org", in the Seer Autofix and Agent out-of-credits notifications. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…uto-reload The Seer Autofix and Agent out-of-credits notifications now take has_billing_access and auto_reload_enabled. Billing members are told to set up auto-reload, or that they have no auto-reloads remaining when it is already on, and get the "Configure auto-reload" button. Everyone else is told to ask an admin and gets no button. Both fields default to False, so a notification sent without knowing the reader uses the member copy. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…its replies Readers without billing access now get a "Contact Admin" button on the Seer Autofix and Agent out-of-credits notifications. The click is acknowledged and does nothing yet; the handler that emails the billing admins comes later. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Pick the button's text, action, style and URL per variant in an if/else, then append a single button, instead of appending in two places. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Adds notification platform templates for Seer Autofix and Seer Agent.
Also adds a section in the PR renderer to show that the PR was not created/updated due to seer quota shortage.
currently the "configure autoreload" button redirects you to the billing page, and "Contact admin" does nothing, but will follow-up to call this endpoint: https://github.com/getsentry/getsentry/blob/master/getsentry/api/seer_top_up_request.py
Part of CW-2325