Skip to content

Comments

fix: propagate filter_stats to TUI metrics in native tool path#480

Merged
bug-ops merged 1 commit intomainfrom
feat/m26.1/fix-tui-filter-metrics
Feb 17, 2026
Merged

fix: propagate filter_stats to TUI metrics in native tool path#480
bug-ops merged 1 commit intomainfrom
feat/m26.1/fix-tui-filter-metrics

Conversation

@bug-ops
Copy link
Owner

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

Summary

  • Fix filter metrics never appearing in TUI dashboard when using native tool_use providers (Claude, OpenAI)
  • handle_native_tool_calls was silently discarding ToolOutput.filter_stats, keeping filter_applications at 0 and the TUI filter block permanently hidden
  • Remove spurious duplicate ToolEvent::Completed emission in shell executor that sent filter_stats: None before filtering was applied

Changes

  • zeph-core/agent/streaming.rs — replicate handle_tool_result filter metrics logic in handle_native_tool_calls: update MetricsSnapshot counters (raw/saved tokens, applications, commands, confidence distribution) and send inline stats to channel
  • zeph-tools/shell.rs — remove early ToolEvent::Completed with filter_stats: None emitted before filtering; keep only the post-filter event with correct stats

Test plan

  • cargo nextest run --workspace --lib --bins — 1568 passed, 0 failed
  • cargo clippy --workspace -- -D warnings — clean
  • cargo +nightly fmt --check — clean
  • Manual: run cargo run -- --tui, execute shell commands via native tool_use provider, verify filter stats appear in Resources panel

Closes #448

handle_native_tool_calls was discarding ToolOutput.filter_stats, causing
filter_applications to remain zero and the TUI filter block to stay hidden.
Replicate the same update_metrics and inline stats logic from handle_tool_result.

Also remove the spurious ToolEvent::Completed emitted in shell.rs before
filtering is applied (filter_stats: None). The second event after filtering
already carries correct per_block_stats.
@github-actions github-actions bot added bug Something isn't working size/S rust core labels Feb 17, 2026
@bug-ops bug-ops enabled auto-merge (squash) February 17, 2026 17:25
@bug-ops bug-ops merged commit 80e358e into main Feb 17, 2026
18 checks passed
@bug-ops bug-ops deleted the feat/m26.1/fix-tui-filter-metrics branch February 17, 2026 17:31
@bug-ops bug-ops restored the feat/m26.1/fix-tui-filter-metrics branch February 17, 2026 17:33
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/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: display filter metrics in TUI dashboard

1 participant