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(proxy): catch asyncio.TimeoutError in Codex memory-context fail-open

Adryan Eka Vandrac553e23ac751
diff --git a/headroom/proxy/handlers/openai.py b/headroom/proxy/handlers/openai.py
index 40388386b..8b96d0313 100644
--- a/headroom/proxy/handlers/openai.py
+++ b/headroom/proxy/handlers/openai.py
@@ -1000,7 +1000,7 @@ class OpenAIHandlerMixin:
),
timeout=RESPONSES_CONTEXT_SEARCH_TIMEOUT_SECONDS,
)
- except TimeoutError:
+ except asyncio.TimeoutError:
memory_context = None
logger.info(
f"[{request_id}] Memory context lookup exceeded "
@@ -1506,7 +1506,7 @@ class OpenAIHandlerMixin:
),
timeout=RESPONSES_CONTEXT_SEARCH_TIMEOUT_SECONDS,
)
- except TimeoutError:
+ except asyncio.TimeoutError:
memory_context = None
logger.info(
f"[{request_id}] WS Memory: Context lookup exceeded "