{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-sse-stream-after-a-server-side-session-eviction-and-silently-adopts-a-new-session-s-event-ids",
  "title": "What happens when an instance resumes an MCP SSE stream after a server-side session eviction and silently adopts a new session's event IDs",
  "date_of_record": "2026 November 22",
  "scope": "Applies to MCP clients using the HTTP-native transport with `text/event-stream` responses and `Last-Event-ID`-based resumption, where the server maintains per-session state keyed by `Mcp-Session-Id`. Does not apply to stdio transports, nor to stateless HTTP servers that emit no event IDs and support no resumption.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-after-a-server-side-session-eviction-and-silently-adopts-a-new-session-s-event-ids.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-after-a-server-side-session-eviction-and-silently-adopts-a-new-session-s-event-ids.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-after-a-server-side-session-eviction-and-silently-adopts-a-new-session-s-event-ids.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1912,
    "python_slice_tokens": 268,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP streamable-HTTP transport conflates two independent identities that most implementations assume are coupled: the **stream cursor** (the `Last-Event-ID` header, an opaque monotonic token used to resume an SSE byte stream) and the **protocol session** (the `Mcp-Session-Id` header, which scopes server-side state — pending requests, negotiated capabiliti...",
    "what_was_observed": "A client agent held session `S1` with `Mcp-Session-Id: 7f3a…`, having consumed events up to `Last-Event-ID: 0042`. The server's session store had a 300-second idle TTL; the client's reconnect backoff after a transient TCP reset was 8 seconds, but a downstream tool call blocked the event loop for 340 seconds, so the reconnect fired at T+348s — 48 seconds past eviction. The reconnect request carried `Mcp-Session-Id: 7f...",
    "condition_of_validity": "Resumption is only sound when three invariants hold simultaneously, and the transport spec does not enforce any of them at the wire level: - **Invariant A (session-cursor binding):** an event ID is valid only within the session that minted it. A server MUST return `404` (or `410`) when `Mcp-Session-Id` is unknown, and MUST NOT fall through to session creatio...",
    "decision_boundary": "The operational question is not \"does resumption work\" but **\"on what signal does the client conclude it has resumed versus forked?\"** The transport gives exactly one trustworthy signal: a *change in `Mcp-Session-Id`*. Everything else — HTTP 200, an open stream, a valid-looking event ID — is consistent with both a genuine resume and a silent fork. Therefore:...",
    "operational_effect": "The blast radius is bounded by what the client does with events it silently drops. In the observed case, a dropped `tools/list_changed` meant the agent kept calling a tool whose schema had been revised in `S2` — the *next* failure was a schema-validation rejection the agent misattributed to the tool, triggering a retry storm that exhausted its token budget. ..."
  },
  "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": "04ae14b79a0560e427fa5c85caaae35a1026bec0537fcaf3e6957a3baf549403",
    "verified_classes": [
      "SessionForkError",
      "SSEResumeGuard"
    ],
    "verified_functions": [
      "handle_reconnect",
      "__init__",
      "on_response_headers",
      "on_event"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SessionForkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
