fix: suppress agent error posts on public broadcast channels (Mastodon)#536
Open
Fail-Safe wants to merge 1 commit intoRightNow-AI:mainfrom
Open
fix: suppress agent error posts on public broadcast channels (Mastodon)#536Fail-Safe wants to merge 1 commit intoRightNow-AI:mainfrom
Fail-Safe wants to merge 1 commit intoRightNow-AI:mainfrom
Conversation
When an agent hit a resource limit (e.g. token quota), the error was formatted and sent back via send_response() — which on Mastodon means posting a public/unlisted status. This caused hundreds of "Agent error: Resource quota exceeded" posts to be published in a burst. Add a suppress_error_responses() method to ChannelAdapter (default false). Mastodon overrides it to true. Both error branches in dispatch_text_message and dispatch_multimodal_message now gate the send_response() call on this flag. Errors are still logged and recorded in delivery history. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a59e099 to
eeb5c7b
Compare
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
suppress_error_responses() -> boolto theChannelAdaptertrait (defaultfalse)MastodonAdapteroverrides totrue— agent errors are logged internally but not posted as statusesdispatch_text_messageanddispatch_multimodal_messageerror branches respect this flagProblem
When an agent hit a resource quota (e.g. token limit exceeded), the error was passed to
send_response()which on Mastodon means callingapi_post_status(). This caused hundreds of"Agent error: Resource quota exceeded: Token limit exceeded"posts to be published to a user's Mastodon account in a burst, all within the same second.Errors are still logged via
warn!()and recorded in delivery history — they're just no longer broadcast as public/unlisted statuses.Why this approach
Adding a trait method keeps the fix localized to adapters that opt in. All existing adapters (Telegram, Slack, Discord, etc.) are unaffected. Any future public broadcast adapters (e.g. Bluesky) can override
suppress_error_responses()totruethe same way.Test plan
cargo build -p openfang-channelspasses cleanly🤖 Generated with Claude Code