{
  "capability": "bonusFeatures.sessionRecovery",
  "slug": "bonusFeatures-sessionRecovery",
  "page": "https://canimcp.io/capabilities/bonusFeatures-sessionRecovery",
  "lifecycle": null,
  "parent": null,
  "children": [],
  "clients": [
    {
      "id": "openai-codex",
      "title": "Codex CLI",
      "kind": "host",
      "page": "https://canimcp.io/clients/openai-codex",
      "status": "full",
      "notes": "A request that gets a 404 on a session re-initializes and is sent once more, tool calls included. In alpha releases a 404 on a reply to a server request also marks the session expired; in-flight calls then fail and the next operation re-initializes. A session left behind by a failed recovery handshake is closed with DELETE (alpha only). It applies to the handshake era only.",
      "evidence": [
        {
          "tier": "read",
          "at": "2025-06-18",
          "source": "openai/codex",
          "date": "2026-11-27",
          "commit": "18c09f20",
          "path": "codex-rs/rmcp-client/src/rmcp_client.rs:RmcpClient.run_service_operation_with_pause_state,RmcpClient.reinitialize_after_session_expiry_inner"
        },
        {
          "tier": "read",
          "at": "2025-06-18",
          "source": "openai/codex",
          "date": "2026-11-27",
          "commit": "18c09f20",
          "path": "codex-rs/rmcp-client/src/session_expiry_transport.rs:SessionExpiryTransport,send",
          "note": "Alpha only (358e3dd0, rust-v0.174.0-alpha.6)."
        }
      ],
      "research": [
        "codex-recovers-expired-http-sessions-two-ways"
      ],
      "tiers": [
        "read"
      ],
      "disagreements": []
    },
    {
      "id": "opencode",
      "title": "opencode",
      "kind": "host",
      "page": "https://canimcp.io/clients/opencode",
      "status": "full",
      "notes": "A 404, or a 400 with body \"Bad Request: Server not initialized\", on a connection that holds an Mcp-Session-Id is mapped to SessionExpiredError, unless the 404 body is a JSON-RPC method-not-found error, which some servers send for a method they do not implement. opencode then reconnects and runs the request once more. This is opencode's own code; the SDK patch no longer contains it. Tool calls, prompt gets, resource reads and resource listing recover this way. At 7cde8329 the recovery was a patch to SDK 1.29.0, recorded here as patchedSdkSessionRecovery. It applies to the handshake era only: a 2026-07-28 connection carries no session id.",
      "evidence": [
        {
          "tier": "read",
          "at": "2025-11-25",
          "source": "anomalyco/opencode",
          "date": "2026-11-27",
          "commit": "5d1f7884",
          "path": "packages/core/src/mcp/client.ts:connect"
        },
        {
          "tier": "read",
          "at": "2025-11-25",
          "source": "anomalyco/opencode",
          "date": "2026-11-27",
          "commit": "5d1f7884",
          "path": "packages/core/src/mcp/connection.ts:make"
        },
        {
          "tier": "read",
          "at": "2025-11-25",
          "source": "anomalyco/opencode",
          "date": "2026-11-27",
          "commit": "5d1f7884",
          "path": "packages/core/src/mcp/index.ts:layer"
        }
      ],
      "research": [
        "opencode-checks-listed-tools-itself-on-a-patched-sdk",
        "opencode-patches-its-sdk-for-session-recovery"
      ],
      "tiers": [
        "read"
      ],
      "disagreements": []
    },
    {
      "id": "hermes-agent",
      "title": "Hermes Agent",
      "kind": "host",
      "page": "https://canimcp.io/clients/hermes-agent",
      "status": "full",
      "notes": "Expired HTTP sessions are detected and the transport reconnected. The call is retried once only for tools annotated readOnlyHint: true; any other tool gets the transport healed and an outcome_uncertain error instead of a replay. A connect-failure cooldown keeps a dead server from being retried in a tight loop, and a parked server first probes after 300 seconds, doubling after each failed revival up to 3600. A stdio server marked single_instance that fails its initial connect attempts parks with no timed probe until an explicit reconnect.",
      "evidence": [
        {
          "tier": "read",
          "at": "2025-11-25",
          "source": "NousResearch/hermes-agent",
          "date": "2026-11-27",
          "commit": "77236c4a",
          "path": "tools/mcp_tool_errors.py:InvalidMcpUrlError._is_streamable_http_rejection"
        },
        {
          "tier": "read",
          "at": "2025-11-25",
          "source": "NousResearch/hermes-agent",
          "date": "2026-11-27",
          "commit": "77236c4a",
          "path": "tools/mcp_tool_handlers.py:_acquire_call_server,_handle_session_expired_and_retry"
        },
        {
          "tier": "read",
          "at": "2025-11-25",
          "source": "NousResearch/hermes-agent",
          "date": "2026-11-27",
          "commit": "77236c4a",
          "path": "tools/mcp_tool_server_run.py:MCPServerRunMixin._log_park,MCPServerRunMixin._on_initial_connect_error"
        },
        {
          "tier": "read",
          "at": "2025-11-25",
          "source": "NousResearch/hermes-agent",
          "date": "2026-11-27",
          "commit": "77236c4a",
          "path": "tools/mcp_tool.py"
        }
      ],
      "research": [
        "openclaw-recovers-expired-http-sessions-without-patching-the-sdk"
      ],
      "tiers": [
        "read"
      ],
      "disagreements": []
    },
    {
      "id": "pi",
      "title": "pi",
      "kind": "host",
      "page": "https://canimcp.io/clients/pi",
      "status": "full",
      "notes": "A 404 on a request that carried a session id raises McpSessionExpiredError. The connection opens a new session and retries the request once, tool calls included, on the reasoning that the server did not run it. Listing and reading resources are also retried once after a 408, 429 or 5xx; tool calls are not.",
      "evidence": [
        {
          "tier": "read",
          "at": "2025-11-25",
          "source": "earendil-works/pi",
          "date": "2026-11-27",
          "commit": "cdf74062",
          "path": "packages/mcp/src/transports/streamable-http.ts:StreamableHttpTransport.checkResponse"
        },
        {
          "tier": "read",
          "at": "2025-11-25",
          "source": "earendil-works/pi",
          "date": "2026-11-27",
          "commit": "cdf74062",
          "path": "packages/coding-agent/src/extensions/mcp/runtime.ts:McpServerConnection"
        }
      ],
      "research": [],
      "tiers": [
        "read"
      ],
      "disagreements": []
    },
    {
      "id": "strands",
      "title": "Strands Agents",
      "kind": "framework",
      "page": "https://canimcp.io/clients/strands",
      "status": "opt-in",
      "notes": "auto_reconnect, off by default and not in a release tag yet: it landed after python/v1.65.0. A tool call that finds the session dropped or terminated stops the client, starts it again with up to four attempts inside one startup_timeout, and re-sends the call once. The docstring warns that a call that already reached the server may run twice. TypeScript has connect(true) and no automatic retry.",
      "evidence": [
        {
          "tier": "read",
          "at": "2026-07-28",
          "source": "strands-agents/harness-sdk",
          "date": "2026-11-27",
          "commit": "78855cad",
          "path": "strands-py/src/strands/tools/mcp/mcp_client.py:MCPClient.__init__"
        },
        {
          "tier": "read",
          "at": "2026-07-28",
          "source": "strands-agents/harness-sdk",
          "date": "2026-11-27",
          "commit": "78855cad",
          "path": "strands-py/src/strands/tools/mcp/mcp_client.py:MCPClient.call_tool_async,MCPClient"
        },
        {
          "tier": "read",
          "at": "2026-07-28",
          "source": "strands-agents/harness-sdk",
          "date": "2026-11-27",
          "commit": "78855cad",
          "path": "strands-ts/src/mcp/client.ts:McpClient,McpClient.connect",
          "note": "TypeScript binding."
        }
      ],
      "research": [],
      "tiers": [
        "read"
      ],
      "disagreements": []
    },
    {
      "id": "deepagents",
      "title": "deepagents",
      "kind": "framework",
      "page": "https://canimcp.io/clients/deepagents",
      "status": "partial",
      "notes": "A FastMCP middleware on each mounted proxy catches a closed connection during tools/call, tears the session down so the next call reconnects, and returns an isError result saying the operation may have completed and was not retried. The failed call is never replayed. A failed token refresh is returned as an error result carrying the login command.",
      "evidence": [
        {
          "tier": "read",
          "at": "2025-11-25",
          "source": "langchain-ai/deepagents",
          "date": "2026-11-27",
          "commit": "c84eb7f1",
          "path": "libs/code/deepagents_code/mcp_proxy.py:MCPBackendMiddleware"
        }
      ],
      "research": [],
      "tiers": [
        "read"
      ],
      "disagreements": []
    },
    {
      "id": "adk-python",
      "title": "Google ADK (Python)",
      "kind": "framework",
      "page": "https://canimcp.io/clients/adk-python",
      "status": "untested",
      "notes": "The recovery path keys on the session-terminated error that the SDK raises for a dropped Mcp-Session-Id. Whether anything triggers it on a connection with no session id was not checked.",
      "evidence": [
        {
          "tier": "read",
          "at": "2025-11-25",
          "source": "google/adk-python",
          "date": "2026-11-27",
          "commit": "03725e8c",
          "path": "src/google/adk/tools/mcp_tool/mcp_session_manager.py:_reports_session_terminated,_is_session_terminated_error,retry_on_errors,MCPSessionManager._discard_session"
        },
        {
          "tier": "read",
          "at": "2025-11-25",
          "source": "google/adk-python",
          "date": "2026-11-27",
          "commit": "03725e8c",
          "path": "src/google/adk/tools/mcp_tool/mcp_tool.py:McpTool._run_async_impl,McpTool._call_tool_on_session"
        }
      ],
      "research": [],
      "tiers": [
        "read"
      ],
      "disagreements": []
    }
  ],
  "notRecorded": [
    "goose",
    "cline",
    "fast-agent",
    "openclaw",
    "kilocode",
    "mastra",
    "fx",
    "libfx",
    "eve",
    "crewai",
    "agent-framework",
    "antigravity",
    "claude-code",
    "claude-ai",
    "chatgpt",
    "codex-desktop",
    "huggingface-chat-ui",
    "cursor",
    "vscode",
    "n8n",
    "langflow",
    "mcp-use",
    "zed",
    "ts-sdk-client",
    "warp",
    "reachy-mini-conversation-app"
  ],
  "research": [
    "codex-recovers-expired-http-sessions-two-ways"
  ],
  "byRevision": {
    "2025-11-25": [
      {
        "id": "fast-agent",
        "title": "fast-agent",
        "kind": "framework",
        "page": "https://canimcp.io/clients/fast-agent",
        "status": "full",
        "notes": "A -32600 \"Session terminated\" on a handshake-era connection is turned into a typed error and, with reconnect_on_disconnect left on, the operation is replayed against a fresh connection. The check explicitly excludes modern connections, which carry no session to lose.",
        "evidence": [
          {
            "tier": "read",
            "at": "2025-11-25",
            "source": "evalstate/fast-agent",
            "date": "2026-11-27",
            "commit": "16f8bb65",
            "path": "src/fast_agent/mcp/client_connection.py:MCPClientConnection._request"
          },
          {
            "tier": "read",
            "at": "2025-11-25",
            "source": "evalstate/fast-agent",
            "date": "2026-11-27",
            "commit": "16f8bb65",
            "path": "src/fast_agent/config.py:MCPServerSettings"
          }
        ],
        "research": [],
        "revisionRecord": "2025-11-25",
        "tiers": [
          "read"
        ],
        "disagreements": []
      },
      {
        "id": "fx",
        "title": "fx (native engine)",
        "kind": "host",
        "page": "https://canimcp.io/clients/fx",
        "status": "full",
        "notes": "A 404 for the current session starts a new session with initialize. A 404 without a session id is a plain failure.",
        "evidence": [
          {
            "tier": "read",
            "at": "2025-11-25",
            "source": "vercel-labs/fx",
            "date": "2026-11-27",
            "commit": "b4502b01",
            "path": "src/mcp/core/http_legacy.zig:step"
          }
        ],
        "research": [],
        "revisionRecord": "2025-11-25",
        "tiers": [
          "read"
        ],
        "disagreements": []
      },
      {
        "id": "adk-python",
        "title": "Google ADK (Python)",
        "kind": "framework",
        "page": "https://canimcp.io/clients/adk-python",
        "status": "full",
        "notes": "When a server reports that it no longer holds the session, ADK drops the pooled session, opens a new one and retries the tool call once. It recognises the SDK's code 32600 on 1.x and INVALID_REQUEST with the message Session terminated on 2.x. A transport failure in the middle of a tool call is not retried. tools/list and session setup are retried once on any error.",
        "evidence": [],
        "research": [],
        "revisionRecord": "2025-11-25",
        "tiers": [],
        "disagreements": []
      },
      {
        "id": "agent-framework",
        "title": "Microsoft Agent Framework",
        "kind": "framework",
        "page": "https://canimcp.io/clients/agent-framework",
        "status": "full",
        "notes": "A ClosedResourceError, or an MCPError whose message contains 'session terminated', counts as connection loss. For a framework-owned connection the tool reconnects, reloads tools and prompts if needed, and retries the tools/call once. mcp 2.3.0 produces that message from an HTTP 404 on a request that carried a session id. A caller-owned Client or ClientSession is not recreated and the call fails. prompts/get retries only on ClosedResourceError. .NET: C# SDK 2.2.0 marks the transport closed on the same 404 and does not re-initialize. dotnet/src has no recovery code, and the clients the framework builds live for one invocation or one response.",
        "evidence": [
          {
            "tier": "read",
            "at": "2025-11-25",
            "source": "microsoft/agent-framework",
            "date": "2026-11-27",
            "commit": "f8ade3e9",
            "path": "python/packages/core/agent_framework/_mcp.py:MCPTool._is_connection_loss"
          },
          {
            "tier": "read",
            "at": "2025-11-25",
            "source": "microsoft/agent-framework",
            "date": "2026-11-27",
            "commit": "f8ade3e9",
            "path": "python/packages/core/agent_framework/_mcp.py:MCPTool._call_tool_with_retries"
          },
          {
            "tier": "read",
            "at": "2025-11-25",
            "source": "microsoft/agent-framework",
            "date": "2026-11-27",
            "commit": "f8ade3e9",
            "path": "python/packages/core/agent_framework/_mcp.py:MCPTool._recover_connection_after_loss",
            "note": "Caller-owned connections are not recreated."
          },
          {
            "tier": "read",
            "at": "2025-11-25",
            "source": "modelcontextprotocol/python-sdk",
            "date": "2026-11-16",
            "path": "mcp/client/streamable_http.py",
            "note": "mcp 2.3.0 wheel. 404 with a session id becomes -32600 \"Session terminated\"."
          },
          {
            "tier": "read",
            "at": "2025-11-25",
            "source": "modelcontextprotocol/csharp-sdk",
            "date": "2026-11-16",
            "commit": "6fa38259",
            "path": "src/ModelContextProtocol.Core/Client/StreamableHttpClientSessionTransport.cs",
            "note": "ModelContextProtocol 2.2.0 (tag v2.2.0). SetSessionExpired stores a ClientTransportClosedException and disconnects."
          }
        ],
        "research": [
          "agent-framework-python-and-dotnet-are-two-mcp-clients"
        ],
        "revisionRecord": "2025-11-25",
        "tiers": [
          "read"
        ],
        "disagreements": []
      },
      {
        "id": "huggingface-chat-ui",
        "title": "Hugging Face Chat UI",
        "kind": "host",
        "page": "https://canimcp.io/clients/huggingface-chat-ui",
        "status": "full",
        "notes": "An HTTP 404 on a call is treated as an expired session: the pooled client is evicted, a new one runs initialize, and the call is sent again, up to twice.",
        "evidence": [
          {
            "tier": "read",
            "at": "2025-11-25",
            "source": "huggingface/chat-ui",
            "date": "2026-11-27",
            "commit": "7fc0f672",
            "path": "src/lib/server/mcp/httpClient.ts:callMcpTool,isSessionExpiredError"
          }
        ],
        "research": [],
        "revisionRecord": "2025-11-25",
        "tiers": [
          "read"
        ],
        "disagreements": []
      }
    ]
  }
}
