fix(core): suppress empty responses to prevent (Silent) channel messages#221
Open
jcenters wants to merge 1 commit intoTinyAGI:mainfrom
Open
fix(core): suppress empty responses to prevent (Silent) channel messages#221jcenters wants to merge 1 commit intoTinyAGI:mainfrom
jcenters wants to merge 1 commit intoTinyAGI:mainfrom
Conversation
When an agent returns an empty string, streamResponse() was still queuing it as an outgoing message. Telegram delivers empty messages as "(Silent)", which is noisy and confusing for users. Added a guard before enqueueResponse() to skip empty messages (no text and no files). These were most commonly produced when agents intentionally ignored crew chat messages or other read-only inputs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR adds a one-guard early-return in Key changes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant streamResponse
participant runOutgoingHooks
participant handleLongResponse
participant enqueueResponse
participant ChannelClient
Caller->>streamResponse: response (possibly empty)
streamResponse->>streamResponse: trim & transform
streamResponse->>streamResponse: collectFiles
streamResponse->>runOutgoingHooks: finalResponse
runOutgoingHooks-->>streamResponse: hookedResponse + metadata
streamResponse->>handleLongResponse: hookedResponse + outboundFiles
handleLongResponse-->>streamResponse: responseMessage + allFiles
alt responseMessage is blank AND allFiles is empty
streamResponse->>streamResponse: log DEBUG "Empty response suppressed"
streamResponse-->>Caller: return (early exit, nothing sent)
else has content or files
streamResponse->>enqueueResponse: channel, sender, message, files...
enqueueResponse->>ChannelClient: deliver message
streamResponse->>streamResponse: emitEvent("response_ready")
end
Last reviewed commit: f70f7d4 |
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.
Problem
When an agent returns an empty string (e.g. when intentionally ignoring a read-only crew chat message),
streamResponse()was still callingenqueueResponse()with an empty message. Telegram delivers empty messages as (Silent), which shows up as a notification with no content — confusing and noisy for users.Fix
Added a guard in
streamResponse()beforeenqueueResponse():Empty responses (no text, no files) are now dropped silently at the pipeline level rather than reaching the channel client.
Related
Companion to #220 (chatroom fan-out loop fix). Both issues were discovered together when agents in a crew team began flooding a user's Telegram with status updates and silent messages.
🤖 Generated with Claude Code