{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-session-is-re-bound-to-a-fresh-sse-channel-mid-tool-call",
  "title": "Why does an instance lose tool-call continuity when an MCP streamable-HTTP session is re-bound to a fresh SSE channel mid-tool-call",
  "date_of_record": "2026 November 25",
  "scope": "Applies to MCP servers/clients using the HTTP-native \"Streamable HTTP\" transport (single endpoint, `POST` for client→server JSON-RPC, optional `GET` for server→client SSE, `Mcp-Session-Id` header for session continuity) where a long-running tool call spans a transport-level reconnect. Does not apply to stdio transport, nor to stateless one-shot HTTP bindings where every request is self-contained.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-session-is-re-bound-to-a-fresh-sse-channel-mid-tool-call.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-session-is-re-bound-to-a-fresh-sse-channel-mid-tool-call.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-session-is-re-bound-to-a-fresh-sse-channel-mid-tool-call.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1863,
    "python_slice_tokens": 252,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the connection dropped.\" TCP/SSE drops are ordinary and recoverable. The failure is that the *session identity* (`Mcp-Session-Id`) and the *stream binding* (which SSE channel carries the response to a given in-flight request `id`) are two different lifetimes, and the Streamable HTTP spec lets them decouple. A client that reconnects and re...",
    "what_was_observed": "A research agent issued `tools/call` for a `web_crawl` tool with a 90s server-side budget. The MCP server (Streamable HTTP) accepted the `POST`, returned `202 Accepted` with an `Mcp-Session-Id`, and began streaming progress notifications and the eventual result over the SSE channel opened by the client's `GET` to the same endpoint. At t≈40s a load balancer idle-timed the `GET` SSE connection (no keepalive frames from...",
    "condition_of_validity": "The failure requires all of the following to co-occur; remove any one and the system degrades gracefully: 1. **A tool call whose wall-clock duration exceeds the transport's idle timeout.** Short calls complete before any reconnect and are unaffected. 2. **Server-side response binding to a specific stream instance**, rather than to a session-scoped outbound q...",
    "decision_boundary": "The client cannot distinguish, from the transport alone, between three states after a reconnect: - **State A:** request still running, will emit on stream B (correct server, queue-bound). - **State B:** request still running, will emit on dead stream A (broken server, stream-bound). - **State C:** request already completed and result was dropped (broken serv...",
    "operational_effect": "The practical consequence is that Streamable HTTP MCP servers must be built around a **session-scoped outbound multiplexer**, not a per-connection writer. Concretely: `Mcp-Session-Id → asyncio.Queue[SSEFrame]`, with each active `GET` stream as a *drainer* of that queue. On reconnect, the new stream drains whatever accumulated. Progress and result frames carr..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "7c79cdb022945f9d3275d3e01417f621df646ab70d161ab72429256e3821e0e3",
    "verified_classes": [
      "OrphanedToolCallError",
      "PendingRequest",
      "SessionState"
    ],
    "verified_functions": [
      "on_sse_reconnect"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "OrphanedToolCallError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
