fix: reconnect MCP sessions on transient stream failures
maintainer edit: treat transient MCP stream failures as dead sessions so the existing reconnect handler can refresh the session before retrying. Also cover retry failure as a structured tool error.
This commit is contained in:
@@ -129,6 +129,8 @@ def _is_transient(exc: BaseException) -> bool:
|
||||
|
||||
def _is_session_terminated(exc: BaseException) -> bool:
|
||||
"""Return True when the MCP SDK reports a dead client session."""
|
||||
if _is_transient(exc):
|
||||
return True
|
||||
messages = [str(exc)]
|
||||
error = getattr(exc, "error", None)
|
||||
if error is not None:
|
||||
|
||||
Reference in New Issue
Block a user