The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(gateway): keep aiohttp web import alive when RequestKey is unavailable
hoozge943e04ba2b31
diff --git a/gateway/platforms/api_server_runs.py b/gateway/platforms/api_server_runs.pyindex 1a7e2fca46d..3873c768899 100644--- a/gateway/platforms/api_server_runs.py+++ b/gateway/platforms/api_server_runs.py@@ -13,9 +13,16 @@ from typing import Any, Callable, Dict, List, Optionaltry:from aiohttp import web- from aiohttp.web_request import RequestKey-except ImportError:+except ImportError: # pragma: no coverweb = None # type: ignore[assignment]+try:+ from aiohttp.web_request import RequestKey+except ImportError: # pragma: no cover+ # aiohttp < 3.14 does not export RequestKey. Import it separately so its+ # absence does not clobber the already-imported ``web`` module: sharing+ # one try/except turned ``web`` into None on older aiohttp, making every+ # non-streaming ``POST /v1/runs`` reply crash with ``AttributeError:+ # 'NoneType' object has no attribute 'json_response'``.RequestKey = None # type: ignore[assignment,misc]from gateway.platforms.api_server_room_grants import _json_error, _room_grant_error_response