fix(channels): prevent tool_calls from being dropped during streaming#2957
Open
loafoe wants to merge 1 commit into
Open
fix(channels): prevent tool_calls from being dropped during streaming#2957loafoe wants to merge 1 commit into
loafoe wants to merge 1 commit into
Conversation
The auxiliary message filtering introduced in sipeed#2892 incorrectly drops tool_calls messages when there is an active stream or a tombstone from a recently finished stream. This causes tool_calls to not be delivered to the UI when users make consecutive requests, as the second request's tool_calls message arrives while the first request's stream is still active or within the 30-second tombstone window. The fix excludes tool_calls from auxiliary message filtering, since they represent new tool invocations that must be delivered to the UI, not stale auxiliary content like feedback or thoughts. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Author
|
@imguoguo please check this one, it fixes a bug in the recently merged streaming which causes tool call messages to be dropped silently! |
This was referenced May 28, 2026
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
outboundMessageIsToolCalls()helper functionpreSend()Problem
The auxiliary message filtering introduced in #2892 incorrectly drops
tool_callsmessages when:This causes tool_calls to not be delivered to the pico channel UI when users make consecutive requests, as the second request's tool_calls message arrives while the first request's stream is still active or within the tombstone window.
Root Cause
outboundMessageHasAuxiliaryKind()returnstruefor any message withmessage_kindset, which includestool_calls. The filtering logic inpreSend()then drops these messages to prevent stale feedback/thoughts from leaking after streaming.However,
tool_callsmessages represent new tool invocations for the current turn - they are not stale auxiliary content and must be delivered to the UI.Fix
Exclude
tool_callsfrom auxiliary message filtering:Test plan
🤖 Generated with Claude Code