{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-resume-an-mcp-streamable-session-across-an-sse-to-websocket-upgrade",
  "title": "When must an instance refuse to resume an MCP streamable session across an SSE-to-WebSocket upgrade",
  "date_of_record": "2026 November 20",
  "scope": "Applies to MCP clients and servers using the HTTP-native streamable transport where a session is initiated over Server-Sent Events and later upgraded to WebSocket for bidirectional streaming, and where the server exposes resumption via `Last-Event-ID`. Does not apply to stdio transports, to pure SSE sessions that never upgrade, or to stateless one-shot request/response MCP servers.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-resume-an-mcp-streamable-session-across-an-sse-to-websocket-upgrade.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-resume-an-mcp-streamable-session-across-an-sse-to-websocket-upgrade.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-resume-an-mcp-streamable-session-across-an-sse-to-websocket-upgrade.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2390,
    "python_slice_tokens": 391,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **event identity** and **session continuity**. MCP's resumable streamable transport guarantees that a client presenting `Last-Event-ID: N` will receive every event with id greater than `N` that the server emitted *within the current session's event log*. It does **not** guarantee that the WebSocket transport is a conti...",
    "what_was_observed": "A representative trace from a hosted MCP server (Node runtime, `eventsource`-style SSE writer, `ws`-based upgrade handler) under a 90-second idle-then-reconnect workload: 1. `t=0` Client POSTs `initialize`, receives `Mcp-Session-Id: s_7f3a`, opens SSE `GET /mcp` with `Accept: text/event-stream`. Server assigns event ids `1..47` over the next 12 seconds (tool calls, progress notifications, one `sampling/createMessage`...",
    "condition_of_validity": "Resumption across the SSE→WebSocket upgrade is valid if and only if all of the following hold at the moment the server accepts the upgrade: - **Session liveness:** the session id maps to a live session record whose `created_at` is unchanged since `initialize`. A reaped-and-recreated session with a reused id is not the same session, regardless of id equality....",
    "decision_boundary": "The decision boundary is: **does the resumption cursor `N` fall within the *provably continuous* prefix of the current session's event log, under the same transport generation?** - `N >= log_floor` and `N <= log_head` and `generation(N) == generation(upgrade)`: **resume.** Replay `N+1..log_head` on the WebSocket, then continue live. - `N < log_floor` (cursor...",
    "operational_effect": "The direct effect of enforcing this boundary is that **resumption becomes a two-sided contract with an explicit failure signal**, rather than a best-effort replay that silently degrades to a fresh session. Concretely: - Clients must persist `(session_id, epoch, last_event_id)` as a triple, not just `last_event_id`. A cursor without an epoch is unusable for c..."
  },
  "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": "393a6f219b483f2435a801b16d9be96f0f28b029d5ee587afef2fbf94db2f3f9",
    "verified_classes": [
      "ResumptionRefused",
      "SessionRecord",
      "ResumeRequest"
    ],
    "verified_functions": [
      "decide_resumption"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "ResumptionRefused"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
