fix: resolve gap analysis — new handlers, wider redundancy window, token budget#15
Merged
claudioemmanuel merged 1 commit intodevelopfrom Apr 7, 2026
Merged
Conversation
…ken budget - jq/yq/terraform/tofu/helm/pulumi: DataToolHandler (terraform: strip unchanged resources, keep +/-/~ and Plan: lines; helm: strip boilerplate; jq/yq: drop empty/null lines + truncate) - grep/rg/awk/sed: TextProcHandler (collapse files with ≥5 matches to summary line; dedup + truncate) - podman, nextest, az: added to filter.rs routing table - RECENT_WINDOW: 8→16 (catch repeated outputs in longer call sequences) - MIN_LINES: 5→2 (short outputs like `git status` 2-liner now eligible for dedup) - compact_threshold_tokens default: 160K→120K (50K safety margin for sonnet-4-6 200K context; avoids truncation from protocol overhead + system prompt) - Per-tool token breakdown in compact warning: Bash/Read/Other separate counters persisted to context.json via SessionContext.note_tool_tokens() - README: deduplicated benchmark header, updated config defaults, handler table, redundancy window and compact warning documentation
claudioemmanuel
added a commit
that referenced
this pull request
Apr 7, 2026
fix: resolve gap analysis — new handlers, wider redundancy window, token budget
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.
Closes #14
Summary
jq,yq,terraform/tofu(strips unchanged resources, keeps+/-/~and Plan: lines),helm(strips boilerplate),pulumi,grep/rg/awk/sed(collapses files with ≥5 matches to a summary line),podman,nextest,azgit statusnow eligible for dedup)compact_threshold_tokensdefault 160K→120K (leaves a 50K margin for sonnet-4-6 200K context; avoids truncation from system prompt + protocol overhead)Bash/Read/Othersplit, persisted tocontext.jsonviaSessionContext.note_tool_tokens()Test plan
cargo test— all 240 tests pass (0 failures)bash bench/run.sh— 14/14 fixtures ≥23% reduction, ≤15ms latency