GlobalRouter.__init__ always creates both self._client and self._async_client, but close() only closes the sync client and aclose() only closes the async client. A sync with GlobalRouter(...) therefore leaves the async client's connection pool open, while async with GlobalRouter(...) leaves the sync client open. This is directly reproducible with c = GlobalRouter(api_key='x'); c.close(); assert c._async_client.is_closed, which fails. The lifecycle methods should close both clients, or the SDK should lazily create only the client flavor being used.
File: src/globalrouter/_client.py
Line: 77
Severity: medium
Summary: unclosed companion client in globalrouter lifecycle
GlobalRouter.__init__always creates bothself._clientandself._async_client, butclose()only closes the sync client andaclose()only closes the async client. A syncwith GlobalRouter(...)therefore leaves the async client's connection pool open, whileasync with GlobalRouter(...)leaves the sync client open. This is directly reproducible withc = GlobalRouter(api_key='x'); c.close(); assert c._async_client.is_closed, which fails. The lifecycle methods should close both clients, or the SDK should lazily create only the client flavor being used.File:
src/globalrouter/_client.pyLine: 77
Severity: medium
Summary: unclosed companion client in globalrouter lifecycle