Skip to content

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.

fix(test): stub _run_compression_in_executor on _DummyOpenAIHandler

chopratejas456a6b33af06
diff --git a/tests/test_openai_codex_routing.py b/tests/test_openai_codex_routing.py
index 62eb5e327..c56a2f9ae 100644
--- a/tests/test_openai_codex_routing.py
+++ b/tests/test_openai_codex_routing.py
@@ -154,6 +154,13 @@ class _DummyOpenAIHandler(OpenAIHandlerMixin):
self.captured_request = (method, url, headers, body)
return _ResponseStub()
+ async def _run_compression_in_executor(self, fn, *, timeout: float):
+ # Test stub for HeadroomProxy._run_compression_in_executor.
+ # The real implementation runs `fn` on a bounded thread pool with
+ # a wall-clock timeout; tests just need the callable invoked
+ # synchronously so MagicMock call_count assertions fire.
+ return fn()
+
async def _stream_response(
self,
url: str,