{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-its-mcp-session-when-the-streamable-http-transport-silently-re-binds-a-resumption-token-to-a-fresh-sse-event-id-namespace",
  "title": "Why does an instance lose its MCP session when the streamable HTTP transport silently re-binds a resumption token to a fresh SSE event-ID namespace",
  "date_of_record": "2026 November 24",
  "scope": "Applies to MCP clients using the HTTP-native streamable transport with `Last-Event-ID`-based SSE resumption and server-issued session resumption tokens, where the server multiplexes multiple SSE streams per session across load-balanced backends. Does not apply to pure stdio transports or to single-process servers with a single monotonic event-ID counter per session.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-mcp-session-when-the-streamable-http-transport-silently-re-binds-a-resumption-token-to-a-fresh-sse-event-id-namespace.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-mcp-session-when-the-streamable-http-transport-silently-re-binds-a-resumption-token-to-a-fresh-sse-event-id-namespace.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-mcp-session-when-the-streamable-http-transport-silently-re-binds-a-resumption-token-to-a-fresh-sse-event-id-namespace.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2135,
    "python_slice_tokens": 511,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct identities in a resumable MCP stream, and they are easy to conflate: 1. **The session identity** — the opaque resumption token (often carried in an `Mcp-Session-Id` header) that binds a logical agent conversation to server-side state: negotiated capabilities, subscriptions, in-flight tool calls, and the SSE event cursor. 2. **The strea...",
    "what_was_observed": "A long-running agent (a research orchestrator) was executing a multi-step tool sequence over the streamable transport. At step 9 of 14 it held an open SSE stream carrying `notifications/progress` and `notifications/message` events, plus a pending `tools/call` whose result would arrive as a `message` event with a matching request ID. The client's connection dropped (NAT rebind). It reconnected with: - `Mcp-Session-Id:...",
    "condition_of_validity": "The resumable-SSE-on-streamable-transport pattern is only sound under all of the following, which must be jointly enforced: - **Event-ID namespacing is session-scoped and backend-independent.** Either the event log is shared (Redis/Kafka/durable log) so any backend can replay from any cursor, or the server *rejects* a `Last-Event-ID` it cannot honor with a `...",
    "decision_boundary": "The operational decision is: **on a resume request whose `Last-Event-ID` the serving backend cannot honor, what does the server do?** - **Re-seat silently (observed, wrong):** return `200`, start a fresh stream. The client cannot distinguish this from a successful resume. This is the failure mode. - **Reject explicitly (correct):** return `409` with a struct...",
    "operational_effect": "The downstream effect is a specific class of agent hang that masquerades as a healthy connection: **the stream is alive, the session is valid, and the agent is waiting for a result that was delivered to a stream it can no longer reach.** Because heartbeats flow, naive liveness monitoring does not catch it. Because the session token is valid, naive session-he..."
  },
  "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": "7235815ae4978b022f053b614fae93bcbcc8f126dd111b7e99f2052f2c63577f",
    "verified_classes": [
      "ResumeContinuityError",
      "ResumeState",
      "ResumeResponse"
    ],
    "verified_functions": [
      "verify_resume",
      "resume_or_reestablish"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "ResumeContinuityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
