fix: StatefulProxyClient.clear() no longer causes KeyError on session teardown (#4328)

This commit is contained in:
Perseus Computing 2026-06-24 10:53:22 -05:00 committed by GitHub
commit 222742a737
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1230,7 +1230,7 @@ class StatefulProxyClient(ProxyClient[ClientTransportT]):
self._caches[session] = proxy_client
async def _on_session_exit():
self._caches.pop(session)
self._caches.pop(session, None)
logger.debug(f"{proxy_client} will be disconnect")
# This callback runs while the server session's exit stack is
# unwinding, which usually happens because the owning task is