Skip to content

feat(notifications): Add out-of-credits notifications for Seer Autofix and Agent - #130500

Open
alexsohn1126 wants to merge 11 commits into
masterfrom
alexsohn/cw-2325-autofix-out-of-credits-notification
Open

alexsohn1126 wants to merge 11 commits into
masterfrom
alexsohn/cw-2325-autofix-out-of-credits-notification

Conversation

@alexsohn1126

@alexsohn1126 alexsohn1126 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

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.

Scenario Screenshot
Autofix, member image
Autofix, billing access, auto-reload off image
Autofix, billing access, auto-reload on image
Agent, member image
Agent, billing access, auto-reload off image
Agent, billing access, auto-reload on image

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

@linear-code

linear-code Bot commented Nov 9, 2026

Copy link
Copy Markdown

CW-2325

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 9, 2026
@alexsohn1126 alexsohn1126 changed the title feat(notifications): Add an out-of-credits notification for Seer Autofix feat(notifications): Add out-of-credits notifications for Seer Autofix and Agent Nov 9, 2026
# TODO(alexsohn): change this to top-up or request credits link
billing_url = organization.absolute_url(
f"/settings/{organization.slug}/billing/overview/"
)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will update this once the request top-up/request credits page has been implemented, as well as the button text below.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@alexsohn1126

Copy link
Copy Markdown
Member Author

bugbot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@alexsohn1126
alexsohn1126 force-pushed the alexsohn/cw-2325-autofix-out-of-credits-notification branch 3 times, most recently from 19ea9a1 to 6e36b0a Compare November 12, 2026 15:26
@alexsohn1126
alexsohn1126 marked this pull request as ready for review November 12, 2026 15:28
@alexsohn1126
alexsohn1126 requested review from a team as code owners November 12, 2026 15:28
@sentry

sentry Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 824 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

Base automatically changed from alexsohn/cw-2342-slack-check-seer-credits-before-running-an-agent-chat to master November 12, 2026 17:41
alexsohn1126 and others added 6 commits November 12, 2026 12:53
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>
@alexsohn1126
alexsohn1126 force-pushed the alexsohn/cw-2325-autofix-out-of-credits-notification branch from 6e36b0a to 3077054 Compare November 12, 2026 17:59
Comment on lines +240 to +243
# TODO(alexsohn): change this to top-up or request credits link
billing_url = organization.absolute_url(
f"/settings/{organization.slug}/billing/overview/"
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we need to add a hardlink to the auto reload modal?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea that would be great!

ActionsBlock(
elements=[
LinkButtonElement(
text="Configure autoreload",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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."

@srest2021 srest2021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, just some copy nits!

)


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."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

alexsohn1126 and others added 4 commits November 12, 2026 14:13
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>

This branch has not been deployed

No deployments
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.

3 participants