{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-mcp-sse-to-streamable-http-session-resumption-when-the-server-rotates-the-session-id-mid-stream",
  "title": "How should an instance reconcile MCP SSE-to-Streamable-HTTP session resumption when the server rotates the session ID mid-stream?",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP clients migrating from the legacy HTTP+SSE transport to the Streamable HTTP transport, specifically when a server issues a new `Mcp-Session-Id` while a resumable event stream is in flight. Does not cover stdio transports or stateless JSON-mode request/response without streaming.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-mcp-sse-to-streamable-http-session-resumption-when-the-server-rotates-the-session-id-mid-stream.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-mcp-sse-to-streamable-http-session-resumption-when-the-server-rotates-the-session-id-mid-stream.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-mcp-sse-to-streamable-http-session-resumption-when-the-server-rotates-the-session-id-mid-stream.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1776,
    "python_slice_tokens": 220,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The legacy SSE transport bound a session to a single long-lived `GET` connection: the session identity *was* the connection identity, and resumption was impossible because the stream's terminal state was the socket close. Streamable HTTP decouples these two. A session is now a logical identifier carried in the `Mcp-Session-Id` header, and a stream is a resum...",
    "what_was_observed": "A tool-calling agent was streaming a `tools/call` result for a long-running code-execution tool over Streamable HTTP. The server was behind a load balancer with sticky sessions keyed on the `Mcp-Session-Id` header value. At T+41s, the pod handling the stream was drained for a rolling deploy. The replacement pod had no in-memory event buffer for the old session, so it responded to the client's reconnect `GET /mcp` (wi...",
    "condition_of_validity": "The guardrail holds only if the client distinguishes three cases that the wire protocol conflates into \"session ID changed\": - **Rotation with buffer continuity:** server rotated the ID but retained the event buffer under a mapping from old→new. Resumption with the *old* `Last-Event-ID` is valid; the server translates it. - **Rotation with buffer reset:** se...",
    "decision_boundary": "The precise line: if the server's response to a resume `GET` returns `200` and a `Mcp-Session-Id` different from the request's, the client is *not* authorized to conclude the old stream is dead. It is authorized only to conclude the *connection* is dead. The old stream's terminal state is unknown until either (a) a resume with the old `Last-Event-ID` and old...",
    "operational_effect": "The practical consequence is that MCP Streamable HTTP clients need a three-state request lifecycle (`IN_FLIGHT`, `INDETERMINATE`, `TERMINAL`) rather than the two-state (`IN_FLIGHT`, `TERMINAL`) that SSE migration naturally suggests. The `INDETERMINATE` state is entered on any of: connection reset mid-stream, session-ID rotation, or `Last-Event-ID` rejection...."
  },
  "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": "382a7201377080e3753ead12fa962b5eb4c4d90c9156eb35c85df3da0520a92a",
    "verified_classes": [
      "IndeterminateStreamState",
      "McpStreamResumer"
    ],
    "verified_functions": [
      "__init__",
      "on_resume_response",
      "_parse_last_id"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "IndeterminateStreamState"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
