fix: show inline filter stats based on char savings, not line count#483
Merged
fix: show inline filter stats based on char savings, not line count#483
Conversation
The inline filter stats were never shown for bash because the condition checked filtered_lines < raw_lines. Filters that compact line content without removing lines (e.g. truncation) reduce chars but not line count. Switch both text-mode and native tool_use paths to filtered_chars < raw_chars.
4585d3b to
4a3882b
Compare
Add command field to FilterStats and display it in the inline stats line so users can see which command was filtered.
…ssage Inline stats were sent as a separate channel message, which created a distinct [zeph] block with different styling. Now they are appended to the tool output so bash blocks render uniformly.
Strips compilation noise (Compiling, Downloading, Checking, Fetching, etc.) from cargo output, keeping errors, warnings, and the Finished summary line. Covers all cargo subcommands not already handled by clippy and test filters.
TUI compact mode truncates long output showing only first N lines. Inline stats appended at the end were hidden behind the fold. Move them before the tool output so they are always visible.
Stats line was placed outside format_tool_output, causing TUI to render it as a separate zeph message instead of part of the bash block. Now stats are prepended to the body before format_tool_output wraps it.
…cation Add Loaded/Blocking/Unpacking to noise prefixes for cargo audit output. For commands like cargo tree with no noise prefixes but many lines, apply generic head/tail truncation (keep first 10 + last 5 lines).
Route filter_stats through ToolEvent -> AgentEvent -> ChatMessage pipeline so TUI displays filtering percentage in the expand hint line. Strip ANSI charset escape sequences (ESC(B). Fix clippy filter to remove cargo noise when no warnings. Fix cargo_build filter to strip noise regardless of exit code and truncate long kept output. Remove security pattern recount that inflated filtered_chars.
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
[bash] 150 lines -> 1 lines, 99.2% filtered) were never displayed in chat because the gate condition checkedfiltered_lines < raw_linesfiltered_charsbut keepfiltered_lines == raw_lines, so the condition was never truefiltered_chars < raw_charsTest plan