mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-07 02:51:50 +00:00
fix(mcp): reconnect on terminated sessions
This commit is contained in:
parent
2658494e81
commit
4a2f822137
2 changed files with 8 additions and 0 deletions
|
|
@ -46,6 +46,13 @@ def test_is_session_expired_detects_session_not_found():
|
||||||
assert _is_session_expired_error(RuntimeError("Unknown session: abc123")) is True
|
assert _is_session_expired_error(RuntimeError("Unknown session: abc123")) is True
|
||||||
|
|
||||||
|
|
||||||
|
def test_is_session_expired_detects_session_terminated():
|
||||||
|
"""Remote Playwright MCP reports transport loss as ``Session terminated``."""
|
||||||
|
from tools.mcp_tool import _is_session_expired_error
|
||||||
|
|
||||||
|
assert _is_session_expired_error(RuntimeError("Session terminated")) is True
|
||||||
|
|
||||||
|
|
||||||
def test_is_session_expired_is_case_insensitive():
|
def test_is_session_expired_is_case_insensitive():
|
||||||
"""Match uses lower-cased comparison so servers that emit the
|
"""Match uses lower-cased comparison so servers that emit the
|
||||||
message in different cases (SDK formatter quirks) still trigger."""
|
message in different cases (SDK formatter quirks) still trigger."""
|
||||||
|
|
|
||||||
|
|
@ -1667,6 +1667,7 @@ _SESSION_EXPIRED_MARKERS: tuple = (
|
||||||
"session expired",
|
"session expired",
|
||||||
"session not found",
|
"session not found",
|
||||||
"unknown session",
|
"unknown session",
|
||||||
|
"session terminated",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue