{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-mcp-stream-resumption-against-session-re-binding-when-a-long-lived-tool-call-outlives-its-sse-transport",
  "title": "How should an instance reconcile MCP stream resumption against session re-binding when a long-lived tool call outlives its SSE transport",
  "date_of_record": "2026 November 22",
  "scope": "Applies to MCP clients using the HTTP-native transport (Streamable HTTP with `Mcp-Session-Id` and `Last-Event-ID` resumption) that issue long-running tool calls whose server-side execution exceeds the lifetime of a single SSE stream. Does not apply to stdio transport, nor to stateless HTTP servers that omit session IDs and event IDs entirely.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-mcp-stream-resumption-against-session-re-binding-when-a-long-lived-tool-call-outlives-its-sse-transport.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-mcp-stream-resumption-against-session-re-binding-when-a-long-lived-tool-call-outlives-its-sse-transport.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-mcp-stream-resumption-against-session-re-binding-when-a-long-lived-tool-call-outlives-its-sse-transport.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1961,
    "python_slice_tokens": 324,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two *independent* continuity mechanisms in MCP's HTTP-native transport, and they are routinely conflated: 1. **Stream resumption** — a transport-layer replay guarantee. The client reconnects to the SSE endpoint (or POSTs with `Last-Event-ID`) and the server replays events after the given ID. This is about *delivery* of already-emitted messages. 2. ...",
    "what_was_observed": "A long-lived `run_migration` tool call (server-side execution ~40 minutes) was issued over Streamable HTTP. The server emitted progress notifications as SSE events every 30s with monotonically increasing `id:` values, then the client's TCP connection was silently dropped by an intermediate proxy at t+15min (idle timeout, no `event: close`). The client's reconnect logic: 1. Re-opened the SSE `GET` with `Mcp-Session-Id...",
    "condition_of_validity": "Stream resumption is only sound when **all** of the following hold on the reconnect response: - The response `Mcp-Session-Id` header (if present) **equals** the request's `Mcp-Session-Id`. Any change is a rebind and invalidates resumption for any in-flight call. - The replayed `Last-Event-ID` cursor is **contiguous** with the last event the client actually c...",
    "decision_boundary": "The decision boundary is whether the client can *distinguish* \"same session, stream resumed\" from \"new session, stream replayed.\" Concretely, on every reconnect: Two further boundaries matter operationally: - **Idempotency boundary:** any tool call whose server-side execution can outlive the transport *must* carry a client-generated idempotency key, and the ...",
    "operational_effect": "The practical consequence: **a 200 with replayed events is not evidence of continuity.** Agents that treat SSE reconnection as transparent will silently duplicate side-effecting tool calls whenever the server's session TTL and event-log retention are decoupled — which is the common deployment, because session stores are usually short-TTL (Redis, memory) whil..."
  },
  "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": "b9b6dbb342c9ca8468d2dbd56a1e208c6fbd8e47a5e11effdbde717655f58a9f",
    "verified_classes": [
      "ResumptionRebindError",
      "ReconnectResult"
    ],
    "verified_functions": [
      "validate_resumption",
      "await_long_tool_call"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ResumptionRebindError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
