Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Python agentaianthropicclaude-codecompressioncontext-engineeringcontext-windowcursorfastapilangchainllmmcpopenaiprompt-engineeringproxypythonragtoken-optimizationtokenstypescript
fix: --disable-kompress should not override fallback_strategy to PASSTHROUGH (#1046)
AKT99!64ca95361a78
diff --git a/headroom/proxy/server.py b/headroom/proxy/server.pyindex 728ab9a7a..5aa80b8b6 100644--- a/headroom/proxy/server.py+++ b/headroom/proxy/server.py@@ -167,7 +167,6 @@ from headroom.transforms import (CacheAligner,CodeAwareCompressor,CodeCompressorConfig,- CompressionStrategy,ContentRouter,ContentRouterConfig,TransformPipeline,@@ -618,7 +617,6 @@ class HeadroomProxy()if config.disable_kompress:router_config.enable_kompress = False- router_config.fallback_strategy = CompressionStrategy.PASSTHROUGH# A non-None exclude_tools replaces DEFAULT_EXCLUDE_TOOLS in# ContentRouter, so merge rather than assign.if config.exclude_tools:diff --git a/tests/test_proxy_disable_kompress.py b/tests/test_proxy_disable_kompress.pyindex a45b590f1..d608b0fbc 100644--- a/tests/test_proxy_disable_kompress.py+++ b/tests/test_proxy_disable_kompress.py@@ -33,7 +33,7 @@ def test_disable_kompress_config_keeps_optimization_but_disables_ml_fallback() -)assert router.config.enable_kompress is False- assert router.config.fallback_strategy == CompressionStrategy.PASSTHROUGH+ assert router.config.fallback_strategy == CompressionStrategy.KOMPRESSdef test_disable_kompress_defaults_to_existing_kompress_behavior() -> None: