Skip to content

fix: resolve gap analysis — new handlers, wider redundancy window, token budget#15

Merged
claudioemmanuel merged 1 commit intodevelopfrom
fix/gap-improvements
Apr 7, 2026
Merged

fix: resolve gap analysis — new handlers, wider redundancy window, token budget#15
claudioemmanuel merged 1 commit intodevelopfrom
fix/gap-improvements

Conversation

@claudioemmanuel
Copy link
Copy Markdown
Owner

Closes #14

Summary

  • New handlers: 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, az
  • Redundancy window: 8→16 (catches repeated outputs across longer call sequences)
  • Min-lines threshold: 5→2 (short outputs like 2-line git status now eligible for dedup)
  • Token budget: compact_threshold_tokens default 160K→120K (leaves a 50K margin for sonnet-4-6 200K context; avoids truncation from system prompt + protocol overhead)
  • Per-tool token breakdown: compact warning now shows Bash/Read/Other split, persisted to context.json via SessionContext.note_tool_tokens()
  • README: handler table, corrected config defaults, redundancy window documentation

Test plan

  • cargo test — all 240 tests pass (0 failures)
  • bash bench/run.sh — 14/14 fixtures ≥23% reduction, ≤15ms latency

…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 claudioemmanuel merged commit b7233b7 into develop Apr 7, 2026
4 checks passed
@claudioemmanuel claudioemmanuel deleted the fix/gap-improvements branch April 7, 2026 05:36
claudioemmanuel added a commit that referenced this pull request Apr 7, 2026
fix: resolve gap analysis — new handlers, wider redundancy window, token budget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant