Skip to content

fix(mcp): reconnect on terminated sessions#19380

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-8c54fd4a
May 3, 2026
Merged

fix(mcp): reconnect on terminated sessions#19380
teknium1 merged 1 commit into
mainfrom
hermes/hermes-8c54fd4a

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

@teknium1 teknium1 commented May 3, 2026

Salvage of #19232 by @LeonSGP43 onto current main.

Summary

Treat MCP Session terminated errors as transport-session expiry signals so the existing reconnect-and-retry path kicks in instead of surfacing a hard tool failure. Observed with remote Playwright MCPs.

Changes

  • tools/mcp_tool.py: add "session terminated" to _SESSION_EXPIRED_PATTERNS
  • tests: regression assertion for the Playwright wording

Validation

scripts/run_tests.sh tests/tools/test_mcp_tool_session_expired.py → 17 passed

Original PR: #19232
Fixes: #18790

@teknium1 teknium1 merged commit 4a2f822 into main May 3, 2026
10 of 11 checks passed
@teknium1 teknium1 deleted the hermes/hermes-8c54fd4a branch May 3, 2026 22:23
@alt-glitch alt-glitch added type/bug Something isn't working tool/mcp MCP client and OAuth P2 Medium — degraded but workaround exists labels May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Medium — degraded but workaround exists tool/mcp MCP client and OAuth type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ERROR tools.mcp_tool: MCP tool playwright/browser_run_code call failed: Session terminated - From Gateway sessions

3 participants