{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-lost-sse-event-window-across-mcp-streamable-http-session-resumption",
  "title": "How does an instance detect a lost SSE event window across MCP streamable-HTTP session resumption",
  "date_of_record": "2026 December 2",
  "scope": "Applies to MCP clients using the streamable-HTTP transport with `Last-Event-ID` resumption after a dropped SSE stream, where the server retains a bounded per-session event log. Does not apply to stdio transports or to servers that hold unbounded event history or that re-emit from a durable log keyed by monotonic sequence.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-lost-sse-event-window-across-mcp-streamable-http-session-resumption.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-lost-sse-event-window-across-mcp-streamable-http-session-resumption.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-lost-sse-event-window-across-mcp-streamable-http-session-resumption.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1790,
    "python_slice_tokens": 396,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the connection dropped.\" A dropped SSE stream is a normal, recoverable event: the client reconnects, sends `Last-Event-ID: N`, and the server replays events `N+1…`. The non-obvious boundary is the case where the server's per-session event buffer has *already evicted* event `N+1` before the client reconnects. In that window the server cann...",
    "what_was_observed": "A tool-calling agent (an MCP client) issued `tools/call` for a long-running `deploy` tool. The server streamed progress notifications as SSE events with monotonically increasing `id` values (event 41 = `progress 0.1`, 42 = `progress 0.4`, 43 = `progress 0.7`, 44 = `result`). The TCP connection to the server was severed mid-stream by a NAT rebind at event 42. The client had durably recorded `Last-Event-ID: 42` (it had...",
    "condition_of_validity": "The gap-detection invariant holds only under these conditions: 1. The server assigns SSE `id` values that are monotonic and gap-free *within a single logical response stream* (MCP requires this for resumability to be meaningful). If the server interleaves unrelated notification streams onto the same session with independent counters, the invariant is void an...",
    "decision_boundary": "On every reconnect that carries a `Last-Event-ID`, the client must perform a **contiguity assertion** before dispatching any replayed event into the agent state machine: - If the first replayed event's `id == Last-Event-ID + 1`: contiguous. Resume normally. - If the first replayed event's `id > Last-Event-ID + 1`: **gap detected**. The server has evicted the...",
    "operational_effect": "Without the assertion, the failure mode is silent and *causally inverted*: the client believes the operation is still running (because it never saw the terminal event) and times out, while the operation actually succeeded. The orchestrator then treats a success as a failure and retries — the classic double-execution that idempotency keys exist to prevent, bu..."
  },
  "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": "c5d9e2b0c8e6bbd5b800051aedf45507d00684c80931cbf19f0980e5f426078a",
    "verified_classes": [
      "ResumptionGapError",
      "SseEvent"
    ],
    "verified_functions": [
      "assert_contiguous_resume",
      "resume_session"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumptionGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
