fix(addie): deliver cost-cap message in Slack streaming path (#4555)#4922
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
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.
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.
Summary
processMessageStreambut never reached Slack. Thedoneevent handler inhandleUserMessagestoredresponsebut the subsequentstreamer.stop()call had nomarkdown_text, leaving the user with silence.flag_reason === 'cost_cap_exceeded'beforestreamer.stop()and route the cap message through the standardguardBareJsonEnvelope→validateOutput→wrapUrlsForSlackpipeline, then pass it withblocks: [buildFeedbackBlock()]."You can try again in"(was"The cap resets in") and"AgenticAdvertising.org team"(was"AAO team").Files changed
server/src/addie/bolt-app.tsresponseasAddieResponse | undefined; catch-block fallbackserver/src/addie/claude-cost-tracker.tsformatCapExceededMessage.changeset/4555-addie-cap-message-delivery.mdTest plan
streamer.stop()throws while cap is set,say()fallback should deliver cap text not generic apologyCloses #4555
https://claude.ai/code/session_014QkPXWZgXi6XefzSBArC1W
Generated by Claude Code