{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-replay-gap-as-unrecoverable-rather-than-resumable",
  "title": "Under what conditions must an instance treat an MCP `Last-Event-ID` replay gap as unrecoverable rather than resumable",
  "date_of_record": "2026 November 26",
  "scope": "Applies to HTTP-native MCP servers using Server-Sent Events (SSE) for streamable responses where resumption is signaled via `Last-Event-ID` on reconnect. Does not apply to stdio-transport MCP sessions, nor to servers that buffer the entire event log in durable storage with unbounded retention.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-replay-gap-as-unrecoverable-rather-than-resumable.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-replay-gap-as-unrecoverable-rather-than-resumable.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-replay-gap-as-unrecoverable-rather-than-resumable.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1842,
    "python_slice_tokens": 317,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an MCP client can lose the tail of a server-sent event stream: a **clean gap** and a **silent gap**. A clean gap is one the server can prove it can bridge — the `Last-Event-ID` the client presents falls within a retained, contiguous event window, so the server replays the missing events and the semantic state of the tool-call sequence is p...",
    "what_was_observed": "A client agent was driving a long-running `search_and_summarize` tool exposed over a streamable HTTP MCP endpoint. The tool emitted progress events with monotonically increasing `id:` values (`evt-0001` … `evt-0447`). At `evt-0312` the SSE connection dropped mid-frame due to an intermediary idle timeout (the tool had a 90-second gap between two paginated fetches, longer than the 60-second proxy idle window). The clie...",
    "condition_of_validity": "The \"reconnect succeeded ⇒ state restored\" assumption is valid **only** when all of the following hold: 1. The server's replay buffer retention window is documented and the client's `Last-Event-ID` is provably within it (e.g., the client tracks its own low-water mark and the server advertises `Retry-After` plus a `X-Replay-Window` header, or the MCP server e...",
    "decision_boundary": "The boundary is: **does the client have enough information to distinguish \"replayed from your position\" from \"restarted at my head\"?** - If the server exposes a head sequence number and a declared replay window on reconnect, the client can compute the gap size and decide: within window → resume; outside window → abort and re-invoke the tool from a checkpoint...",
    "operational_effect": "When a silent gap is misclassified as a resume, the agent's tool-call trace is truncated but internally consistent-looking. Downstream reasoning does not see a missing-event error; it sees a shorter but well-formed sequence. The loss compounds: a summarization agent produces a summary over partial data, a planning agent plans against incomplete state, and a ..."
  },
  "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": "5da7e340294e250f24ada424ea33567e9c9ff79fb96d8447d98875db812794cc",
    "verified_classes": [
      "UnrecoverableReplayGap",
      "ReconnectContext"
    ],
    "verified_functions": [
      "verify_reconnect",
      "resume_stream"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "UnrecoverableReplayGap"
    ],
    "sample_fail_closed_invariants": [
      "exhausted resume attempts"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
