Skip to content

fix(addie): deliver cost-cap message in Slack streaming path (#4555)#4922

Merged
bokelley merged 2 commits into
mainfrom
claude/issue-4555-addie-cap-silent-failure
May 26, 2026
Merged

fix(addie): deliver cost-cap message in Slack streaming path (#4555)#4922
bokelley merged 2 commits into
mainfrom
claude/issue-4555-addie-cap-silent-failure

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • When a user's daily Claude API usage cap fired, the cap message was generated in processMessageStream but never reached Slack. The done event handler in handleUserMessage stored response but the subsequent streamer.stop() call had no markdown_text, leaving the user with silence.
  • Fix: check flag_reason === 'cost_cap_exceeded' before streamer.stop() and route the cap message through the standard guardBareJsonEnvelopevalidateOutputwrapUrlsForSlack pipeline, then pass it with blocks: [buildFeedbackBlock()].
  • Also updates catch-block fallback to use cap message text (not generic apology) for the same case, and fixes copy: "You can try again in" (was "The cap resets in") and "AgenticAdvertising.org team" (was "AAO team").

Files changed

File Change
server/src/addie/bolt-app.ts Cap-exceeded branch in streaming stop path; typed response as AddieResponse | undefined; catch-block fallback
server/src/addie/claude-cost-tracker.ts Copy fixes in formatCapExceededMessage
.changeset/4555-addie-cap-message-delivery.md Empty changeset (Addie-only, non-protocol)

Test plan

  • Trigger cap in staging (or manually set a very low cap) and send a DM — user should receive the cap message inline with the feedback block, not silence
  • Verify non-cap streaming responses are unaffected (feedback block still appears, no duplicate text)
  • Verify catch-block path: if streamer.stop() throws while cap is set, say() fallback should deliver cap text not generic apology
  • Check copy: reset message reads "You can try again in X" and team name reads "AgenticAdvertising.org team"

Closes #4555

https://claude.ai/code/session_014QkPXWZgXi6XefzSBArC1W


Generated by Claude Code

The streaming path collected a `done` event with `flag_reason: 'cost_cap_exceeded'`
but never delivered the cap message — streamer closed with an empty buffer. Route
the cap text through the standard guardBareJsonEnvelope → validateOutput →
wrapUrlsForSlack pipeline and pass it to streamer.stop() with the feedback block.
Update the catch-block fallback and copy ("You can try again in", "AgenticAdvertising.org team").

https://claude.ai/code/session_014QkPXWZgXi6XefzSBArC1W
@bokelley bokelley marked this pull request as ready for review May 22, 2026 18:04

@aao-release-bot aao-release-bot 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.

Argus is not auto-reviewing this PR because it modifies the review workflow itself (.github/workflows/ai-review.yml). Running with the PR head's modified prompt/workflow is a prompt-injection vector. A human reviewer should review and merge this PR; Argus will resume on subsequent PRs once these changes land on main.

@bokelley bokelley merged commit ad79633 into main May 26, 2026
16 checks passed
@bokelley bokelley deleted the claude/issue-4555-addie-cap-silent-failure branch May 26, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better error messaging when user hits daily usage cap

2 participants