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(tests): pin proxy_ccr + text_compressors tests to lossy+CCR path
chopratejas3ad69650b434
diff --git a/tests/test_proxy_ccr.py b/tests/test_proxy_ccr.pyindex beeb85723..123f994a6 100644--- a/tests/test_proxy_ccr.py+++ b/tests/test_proxy_ccr.py@@ -441,7 +441,11 @@ class TestEndToEndTOINIntegration:},]- # Create pipeline with SmartCrusher (same as proxy does)+ # Create pipeline with SmartCrusher (same as proxy does).+ # Use with_compaction=False so we exercise the lossy + CCR+ # caching path that this test asserts. The PR4 lossless+ # default substitutes a CSV+schema string and skips CCR+ # caching (nothing dropped → no cache entry).pipeline = TransformPipeline(transforms=[SmartCrusher(@@ -455,6 +459,7 @@ class TestEndToEndTOINIntegration:inject_retrieval_marker=True,min_items_to_cache=10,),+ with_compaction=False,),],provider=AnthropicProvider(),diff --git a/tests/test_text_compressors.py b/tests/test_text_compressors.pyindex 98ebfdfcc..1b76ea554 100644--- a/tests/test_text_compressors.py+++ b/tests/test_text_compressors.py@@ -390,7 +390,14 @@ class TestSmartCrusherTextIntegration:assert result.compression_ratio < 1.0 # Some compression occurreddef test_smart_crusher_json_still_works(self):- """SmartCrusher still handles JSON correctly."""+ """SmartCrusher still handles JSON correctly.++ Asserts the legacy lossy + JSON-shape behavior: output is a+ JSON-parseable array. The PR4 lossless default substitutes a+ CSV+schema STRING for tabular arrays, which doesn't round-trip+ as a JSON array — that's tested separately in+ `test_smart_crusher_lossless_default.py`.+ """import jsonimport re@@ -413,8 +420,11 @@ class TestSmartCrusherTextIntegration:{"role": "tool", "content": json_content},]+ # Use without_compaction to exercise the legacy lossy + JSON-shape+ # path. Lossless default would substitute a non-JSON string.crusher = SmartCrusher(- config=SmartCrusherConfig(min_tokens_to_crush=10, min_items_to_analyze=5)+ config=SmartCrusherConfig(min_tokens_to_crush=10, min_items_to_analyze=5),+ with_compaction=False,)tokenizer = self._get_tokenizer()