Skip to content

feat(slack): Check Seer credits before running an agent chat mention - #130352

Merged
alexsohn1126 merged 2 commits into
masterfrom
alexsohn/cw-2342-slack-check-seer-credits-before-running-an-agent-chat
Nov 12, 2026
Merged

alexsohn1126 merged 2 commits into
masterfrom
alexsohn/cw-2342-slack-check-seer-credits-before-running-an-agent-chat

Conversation

@alexsohn1126

@alexsohn1126 alexsohn1126 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Adds Seer credit checks before processing @Sentry mentions for Seer Agent calls in Slack.

This one should be pretty straightforward. Once we have the organization of the Seer Agent call, we check whether we have quota before proceeding to trigger the agent.

However, it is important to know how we got the organization in the first place.

When we receive a Slack webhook from a user mentioning Sentry, we have to resolve which organization the webhook is from. The issue is, if there are multiple Sentry organizations linked to a single Slack Workspace, we are not able to tell which organization it is from 😵

We use heuristics to guess the organization we should be looking at, but this is not bulletproof by any means.

All that is just to say -- if there are multiple Sentry orgs linked to a single Slack workspace, the quota check may go to the wrong place, and we won't know when it happens (other than users telling us) 🫤

Fixes CW-2342

@linear-code

linear-code Bot commented Nov 7, 2026

Copy link
Copy Markdown

CW-2342

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 7, 2026
@alexsohn1126
alexsohn1126 removed this pull request from stack #130353 November 9, 2026 15:27
@alexsohn1126
alexsohn1126 marked this pull request as ready for review November 9, 2026 15:40
@alexsohn1126
alexsohn1126 requested a review from a team as a code owner November 9, 2026 15:40

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ff2979f. Configure here.

thread_ts=thread_ts or ts,
status="",
)
return

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.

Out-of-credits halt sends no Slack message

Medium Severity

When the org is out of Seer credits, the mention handler records a halt and clears the thinking status, then returns without telling the user. Sibling halt paths (identity_not_linked, user_not_org_member) send an ephemeral Slack message, and the web chat equivalent returns a 402 with an explanation. Users will see is thinking... vanish with no reply and no indication they are out of credits.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ff2979f. Configure here.

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.

this will be a follow-up

@alexsohn1126
alexsohn1126 force-pushed the alexsohn/cw-2342-slack-check-seer-credits-before-running-an-agent-chat branch from ff2979f to ea395dc Compare November 9, 2026 15:54
@alexsohn1126
alexsohn1126 removed this pull request from stack #130441 November 9, 2026 20:24
@alexsohn1126
alexsohn1126 force-pushed the alexsohn/cw-2342-slack-check-seer-credits-before-running-an-agent-chat branch 2 times, most recently from 0683e3c to fb435c6 Compare November 12, 2026 15:02
@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-2329-slack-gate-autofix-buttons-on-seer-credits to master November 12, 2026 15:26
@alexsohn1126
alexsohn1126 requested a review from a team as a code owner November 12, 2026 15:26
alexsohn1126 and others added 2 commits November 12, 2026 10:26
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
can_run_seer_operation now takes the Seer feature to bill against. Slack
mentions run the agent chat, so they pass the explorer feature like the
web chat endpoint does.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@alexsohn1126
alexsohn1126 force-pushed the alexsohn/cw-2342-slack-check-seer-credits-before-running-an-agent-chat branch from fb435c6 to 0d60c3d Compare November 12, 2026 15:26
@alexsohn1126
alexsohn1126 merged commit cfb8b62 into master Nov 12, 2026
69 checks passed
@alexsohn1126
alexsohn1126 deleted the alexsohn/cw-2342-slack-check-seer-credits-before-running-an-agent-chat branch November 12, 2026 17:42
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