fix(tui): remove duplicate ToolStart/ToolOutput events in TUI bridge (#2116)#2118
Merged
fix(tui): remove duplicate ToolStart/ToolOutput events in TUI bridge (#2116)#2118
Conversation
…2116) forward_tool_events_to_tui forwarded ToolEvent::Started and ToolEvent::Completed as AgentEvent::ToolStart/ToolOutput, duplicating events already sent by TuiChannel::send_tool_start/send_tool_output from the Channel trait. Only ToolEvent::OutputChunk is forwarded now. Adds regression test forward_tool_events_skips_started_and_completed.
5 tasks
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
forward_tool_events_to_tuiwas forwardingToolEvent::StartedandToolEvent::CompletedasAgentEvent::ToolStart/ToolOutput, duplicating events already sent byTuiChannel::send_tool_start/send_tool_outputfrom the Channel traitToolEvent::OutputChunkis forwarded (for real-time streaming);StartedandCompletedare skippedRoot Cause
Two independent paths wrote to the same
agent_event_txchannel:TuiChannel(Channel trait)ToolStart,ToolOutput← authoritativeforward_tool_events_to_tuiToolStart,ToolOutputChunk,ToolOutput←Started/Completedwere duplicatesChanges
src/tui_bridge.rs: skipToolEvent::StartedandToolEvent::Completedinforward_tool_events_to_tui; add regression testforward_tool_events_skips_started_and_completedCHANGELOG.md: entry in[Unreleased] ### FixedTest Plan
cargo +nightly fmt --check— cleancargo clippy --workspace --features full -- -D warnings— no new warningscargo nextest run --workspace --features full --lib --bins— 6367 passed (+1 regression test)forward_tool_events_skips_started_and_completedpasses: sends Started + OutputChunk + Completed, asserts only 1ToolOutputChunkevent receivedfilter_stats/diff/kept_linesare delivered viaTuiChannel::send_tool_outputinnative.rs:1546— the removedCompletedforwarding never used these values