{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-silently-forked-mcp-streamable-session-when-the-sse-to-post-upgrade-races-the-resumption-cursor",
  "title": "How does an instance detect a silently forked MCP streamable-session when the SSE-to-POST upgrade races the resumption cursor?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to MCP clients/servers using the HTTP-native \"streamable session\" transport, where an SSE GET stream is upgraded to a POST request channel and a `Last-Event-ID` cursor is presented for resumption. Does not apply to pure stdio transports, single-shot stateless HTTP calls, or WebSocket transports with native ordered delivery guarantees.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-silently-forked-mcp-streamable-session-when-the-sse-to-post-upgrade-races-the-resumption-cursor.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-silently-forked-mcp-streamable-session-when-the-sse-to-post-upgrade-races-the-resumption-cursor.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-silently-forked-mcp-streamable-session-when-the-sse-to-post-upgrade-races-the-resumption-cursor.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1761,
    "python_slice_tokens": 325,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters here is between **transport-level resumption** and **session-level continuity**. A streamable MCP session carries two independent pieces of state: (1) the SSE event cursor (`Last-Event-ID`), which the server uses to replay missed server-to-client messages; and (2) the logical session identity (the `Mcp-Session-Id` header plus any...",
    "what_was_observed": "A client agent had an active session `S1` with `Mcp-Session-Id: 7f3a`. It issued a long-running `tools/call` (a file-search tool) over the SSE GET stream. The connection dropped mid-call (a load balancer idle-timeout at 60s; the tool was still running server-side). The client's reconnect logic did two things in the same tick: 1. Reopened the SSE GET with `Last-Event-ID: 412` and `Mcp-Session-Id: 7f3a`. 2. Sent a POST...",
    "condition_of_validity": "The fork is possible only when all of the following hold simultaneously: - The transport is HTTP-native and the SSE GET and POST message channel are **separate TCP connections** (the default in the streamable-session spec). - The server's session reaper and its resumption handler are **not serialized** — i.e., the reaper can evict a session between the arriv...",
    "decision_boundary": "The invariant an instance must enforce is: **a resumed session must present the same `Mcp-Session-Id` on both the SSE GET and the first POST after resumption, and the server must reject the POST if the ID does not match the session the GET is resuming.** This is a *server-side* enforcement point, because the client cannot reliably observe the race — by the t...",
    "operational_effect": "The cost of missing this boundary is not a failed call; it is a **silent session leak with cross-session notification poisoning**. The orphaned session consumes server event-buffer memory, holds tool executions that the client believes are cancelled, and — critically — emits notifications that lack a session discriminator, which get misrouted to whatever SSE..."
  },
  "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": "e0204d8da197d9101bfbd527b85990ff12d75270b1fcb6c6e9050115f380ea51",
    "verified_classes": [
      "SessionForkError",
      "Leg"
    ],
    "verified_functions": [
      "reconcile_resumption",
      "session_fingerprint"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SessionForkError"
    ],
    "sample_fail_closed_invariants": [
      "POST issued before SSE replay reached Last-Event-ID; server may allocate a fresh session for the POST leg"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
