Skip to content

Comments

fix: send tool output and diff atomically in native tool_use path#498

Merged
bug-ops merged 2 commits intomainfrom
fix/497/tui-diff-display
Feb 17, 2026
Merged

fix: send tool output and diff atomically in native tool_use path#498
bug-ops merged 2 commits intomainfrom
fix/497/tui-diff-display

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 17, 2026

Summary

  • Fix TUI diff highlight not displaying for native tool_use file edits
  • Add send_tool_output() method to Channel trait that bundles tool name, display text, diff data, and filter stats into a single atomic call
  • TUI channel overrides this to emit one AgentEvent::ToolOutput instead of separate send_diff() + send() calls that raced
  • Handle case where no streaming Tool message exists by creating one on the fly

Test plan

  • cargo check --workspace passes
  • cargo clippy --workspace -- -D warnings clean
  • cargo nextest run --workspace --lib --bins — 1589 tests pass
  • Manual: trigger file edit via native tool_use, verify diff renders in TUI

Closes #497

The DiffReady event was dispatched before the tool message existed in
TUI, so diff data had nothing to attach to. Bundle diff and filter
stats into a single send_tool_output call on the Channel trait so TUI
receives them atomically with the tool message.

Closes #497
@github-actions github-actions bot added rust core bug Something isn't working size/M labels Feb 17, 2026
@bug-ops bug-ops merged commit 2845df9 into main Feb 17, 2026
18 checks passed
@bug-ops bug-ops deleted the fix/497/tui-diff-display branch February 17, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core rust size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: TUI diff highlight not displayed for native tool_use file edits

1 participant