You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tool outputs (shell commands, file reads, test results) are the largest token consumers in the agent context window. Current approach is reactive — truncation and pruning after output exceeds thresholds. Command-aware semantic filtering before insertion into context can achieve 60-90% token savings.
Current State
Zeph has 3-tier compression:
Tier 0: Overflow file when output > 30K chars
Tier 1: Head+tail truncation (15K each) or LLM summarization
Tier 2: Inline pruning of stale tool outputs (keep last 4)
Tier 3: Budget-triggered compaction at 80% context usage
Problem: All tiers operate on raw text without understanding the command semantics. A cargo test with 200 passing tests and 1 failure still sends ~29K chars of passing test output before truncation kicks in.
Approach
Add a command-aware filtering layer in ShellExecutor that runs between command execution and output return. Each filter understands the output format of specific commands and extracts only the information relevant to the agent.
Motivation
Tool outputs (shell commands, file reads, test results) are the largest token consumers in the agent context window. Current approach is reactive — truncation and pruning after output exceeds thresholds. Command-aware semantic filtering before insertion into context can achieve 60-90% token savings.
Current State
Zeph has 3-tier compression:
Problem: All tiers operate on raw text without understanding the command semantics. A
cargo testwith 200 passing tests and 1 failure still sends ~29K chars of passing test output before truncation kicks in.Approach
Add a command-aware filtering layer in
ShellExecutorthat runs between command execution and output return. Each filter understands the output format of specific commands and extracts only the information relevant to the agent.Architecture
OutputFilteris a trait with a registry of command-specific implementations. Filters are composable and configurable viaconfig.toml.Issues
Implementation Order
Non-goals (v1)
Success Criteria