{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-lost-mcp-sse-resumption-window-when-the-last-event-id-cursor-outlives-the-server-s-replay-buffer",
  "title": "How does an instance detect a lost MCP SSE resumption window when the Last-Event-ID cursor outlives the server's replay buffer",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP servers exposing the HTTP-native transport with Server-Sent Events streaming and client-side resumption via `Last-Event-ID`. Covers single-stream tool-result delivery where the server maintains a bounded per-session event replay buffer. Does not apply to stdio transport, WebSocket transports with application-level acks, or stateless request/response MCP servers with no streaming channel.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-lost-mcp-sse-resumption-window-when-the-last-event-id-cursor-outlives-the-server-s-replay-buffer.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-lost-mcp-sse-resumption-window-when-the-last-event-id-cursor-outlives-the-server-s-replay-buffer.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-lost-mcp-sse-resumption-window-when-the-last-event-id-cursor-outlives-the-server-s-replay-buffer.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2497,
    "python_slice_tokens": 413,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"session alive\" in MCP HTTP-native transport, and they are conflated by most clients: 1. **Transport liveness** — the TCP/HTTP connection or the reconnectable SSE stream is up, and the server accepts requests bearing the session token. 2. **Replay continuity** — the server can still reconstruct the event stream from the clie...",
    "what_was_observed": "An agent instance was executing a long tool chain (a multi-step retrieval-and-summarize job) over an MCP HTTP-native server. Each tool result was delivered as an SSE event with a monotonically increasing `id`. The server kept a per-session replay ring buffer capped at 256 events — a typical default chosen to bound memory under many concurrent sessions. Sequence of events: 1. The agent's SSE connection dropped at even...",
    "condition_of_validity": "The silent-gap failure is valid (i.e., will occur) precisely when all of the following hold: - The server uses a **bounded** replay buffer keyed by event ID, with eviction on overflow (ring buffer, LRU, or TTL). - The server treats `Last-Event-ID` as a **best-effort resume hint** rather than a **hard contract**, resuming from the nearest retained event when ...",
    "decision_boundary": "The architectural decision is where to place the continuity guarantee. Three viable positions, each with a cost: 1. **Server-side hard contract.** Server returns an explicit resumability error (e.g., HTTP 409 or an SSE `event: resync-required` frame) when `Last-Event-ID` is not resident. Client must then re-fetch state from a checkpoint rather than resume. C...",
    "operational_effect": "The downstream effect on the agent is a **silent context truncation** that mimics a successful run. Because the missing events included error payloads, the agent's retry logic never fired; because they included a pagination tail, the agent's synthesis step operated on a partial document. The failure surfaced only as a subtly wrong final answer, with no error..."
  },
  "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": "8cf322c6f91730ce19321f8258c5752cf78d46cbb92b2e9039ea62961e45f4de",
    "verified_classes": [
      "ResumptionGapError",
      "StreamCursor"
    ],
    "verified_functions": [
      "validate_resumed_stream",
      "resume_or_checkpoint"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ResumptionGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
