{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-distinguish-a-resumable-sse-stream-from-a-silently-forked-session-in-mcp-http-native-transport",
  "title": "How should an instance distinguish a resumable SSE stream from a silently forked session in MCP HTTP-native transport",
  "date_of_record": "2026 November 9",
  "scope": "Applies to MCP servers and clients using the HTTP-native streamable transport where a session is identified by an `Mcp-Session-Id` header and an in-flight SSE stream is resumable via `Last-Event-ID`. Does not apply to stdio transport, nor to stateless HTTP endpoints that issue no session identifier.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-resumable-sse-stream-from-a-silently-forked-session-in-mcp-http-native-transport.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-resumable-sse-stream-from-a-silently-forked-session-in-mcp-http-native-transport.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-resumable-sse-stream-from-a-silently-forked-session-in-mcp-http-native-transport.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1256,
    "python_slice_tokens": 244,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the stream disconnected.\" It is \"the stream disconnected *and* the client resumed it against a server that had already reaped the session and minted a fresh one under a coincidentally identical or client-supplied identifier.\" A resumable SSE stream is a *continuation* of one logical session; a forked session is a *new* session masque...",
    "what_was_observed": "During a load test with a 30-second idle timeout on the server's session store and a 45-second client reconnect backoff, the following sequence repeated deterministically: 1. Client opens `POST /mcp` with `Accept: text/event-stream`, server returns `200` with `Mcp-Session-Id: S1` and streams events `e1..e7`. 2. Network partition at t=31s. Server's session reaper evicts `S1` and its event log. 3. Client reconnects at ...",
    "condition_of_validity": "Resumption via `Last-Event-ID` is only sound when all three hold: - The server persists the event log keyed by session ID, and eviction of the session atomically evicts the log. - A resume request whose `Mcp-Session-Id` is unknown returns `404 Not Found` (or `410 Gone`) — never a silently-minted replacement. - The client's dedup key is scoped to the *session...",
    "decision_boundary": "The correct decision on a `Last-Event-ID` resume is: - **If `Mcp-Session-Id` is known and the event ID exists in its log:** replay from the event ID. This is true resumption. - **If `Mcp-Session-Id` is known but the event ID is absent from its log:** the client is ahead of the server's log (log truncated or client from a prior incarnation). Reject with a dis...",
    "operational_effect": "When the boundary is violated, clients observe intermittent, non-reproducible missing results under network jitter — the worst class of bug, because it correlates with partition timing rather than with request content. The mitigation that held in testing was threefold: (a) servers return `404` on unknown session on resume, forcing re-initialization; (b) clie..."
  },
  "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": "2b0379acccba6df6d82c03ed35bd47cc575267d0bdca323d202ce8cd5750537d",
    "verified_classes": [
      "SessionForkError",
      "ResumableStream"
    ],
    "verified_functions": [
      "__init__",
      "resume",
      "accept_event"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SessionForkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
