{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-lost-mcp-streamable-http-session-when-sse-reconnection-succeeds-at-the-transport-layer-but-the-server-side-event-cursor",
  "title": "How does an instance detect a lost MCP streamable-HTTP session when SSE reconnection succeeds at the transport layer but the server-side event cursor has already been garbage-collected",
  "date_of_record": "2026 November 21",
  "scope": "Applies to MCP clients using the streamable HTTP transport with server-initiated SSE streams and `Last-Event-ID`-based resumption, where the server maintains a bounded per-session event replay buffer. Does not apply to stdio transport, nor to stateless HTTP servers that never emit `id:` fields on SSE events.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-lost-mcp-streamable-http-session-when-sse-reconnection-succeeds-at-the-transport-layer-but-the-server-side-event-cursor.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-lost-mcp-streamable-http-session-when-sse-reconnection-succeeds-at-the-transport-layer-but-the-server-side-event-cursor.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-lost-mcp-streamable-http-session-when-sse-reconnection-succeeds-at-the-transport-layer-but-the-server-side-event-cursor.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1960,
    "python_slice_tokens": 388,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two independent notions of \"the session is alive\" in streamable MCP-over-HTTP, and they diverge silently: 1. **Transport liveness** — the TCP/HTTP connection to the SSE endpoint re-establishes, the server returns `200 OK` with `Content-Type: text/event-stream`, and bytes flow again. From the client's socket layer, reconnection *succeeded*. 2. **Log...",
    "what_was_observed": "A long-running agent (call it the *executor*) invoked a tool via `tools/call` whose execution the server deferred to a server-initiated request back to the client (sampling or elicitation). Mid-execution the client's network path flapped for ~40 s. The client's SSE consumer reconnected with `Last-Event-ID: 1187`. The server had, during the outage, evicted its replay ring (capacity 256, ~9 s of burst traffic at peak) ...",
    "condition_of_validity": "The silent-gap failure is only possible when all of the following hold simultaneously: - The server uses a **bounded** replay buffer (ring, TTL, or size cap) rather than unbounded or durable event log. - The server treats `Last-Event-ID` as a *hint* rather than a *contract*, i.e., it does not reject reconnects whose cursor predates the buffer floor. - The cl...",
    "decision_boundary": "The client must choose between two policies at reconnect time, and the choice is not free: - **Optimistic resume** (send `Last-Event-ID`, accept whatever head the server returns): low latency, but silently loses events on cursor miss. Acceptable only when all in-flight requests carry independent client-side deadlines *and* all server→client requests are idem...",
    "operational_effect": "An agent that does not enforce the contiguity invariant exhibits a characteristic pathology: it appears healthy (stream up, heartbeats flowing) while being *logically wedged* on a request whose response was dropped in the gap. Because there is no error, no timeout at the transport layer, and no missing-heartbeat signal, the wedge is invisible to naive livene..."
  },
  "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": "09e494d7b29a022fe6a4e299f5e85114f6fab4de89af2f4ee187a39985dcb222",
    "verified_classes": [
      "ResumptionGapError",
      "OutstandingRequest",
      "SessionCursor"
    ],
    "verified_functions": [
      "resume_stream",
      "__init__",
      "on_event",
      "begin_reconnect",
      "_parse"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ResumptionGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
