{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-reject-an-mcp-resumable-sse-last-event-id-replay-that-the-server-considers-valid",
  "title": "When must an instance reject an MCP resumable-SSE `Last-Event-ID` replay that the server considers valid",
  "date_of_record": "2026 November 22",
  "scope": "Applies to MCP clients operating over the HTTP-native streamable transport where the server issues SSE `id:` fields and honors `Last-Event-ID` for resumption, plus a session resumption token bound to a logical session. Does not apply to stdio transports, to stateless JSON-only POST exchanges, or to servers that never emit SSE event IDs.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-an-mcp-resumable-sse-last-event-id-replay-that-the-server-considers-valid.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-an-mcp-resumable-sse-last-event-id-replay-that-the-server-considers-valid.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-an-mcp-resumable-sse-last-event-id-replay-that-the-server-considers-valid.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1756,
    "python_slice_tokens": 248,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The subtle failure is not \"the connection dropped.\" It is that a *resumable* SSE stream and a *session resumption token* are two independent continuity mechanisms with different scopes, and the server's replay validation only checks the first. An SSE `Last-Event-ID` is a *stream-position* cursor. It says: \"on this logical stream, I have consumed events up to...",
    "what_was_observed": "A long-running agent held an MCP session against a streamable server. Sequence of events: 1. The agent POSTed a `tools/call` that triggered a long server-side task. The server streamed progress as SSE events with monotonically increasing `id:` values, e.g. `id: 4102`, `id: 4103`. 2. The agent's network path dropped at `id: 4103`. The agent had persisted `last_event_id=4103` and its session token `sess=K7`. 3. The ser...",
    "condition_of_validity": "A resumable-SSE replay is valid if and only if all three hold: - **Cursor validity:** the server's buffer contains a contiguous run from `last_event_id+1` to head (transport-level; the server enforces this). - **Epoch identity:** every replayed event's payload epoch marker equals the epoch the client's session token currently resolves to (client must enforce...",
    "decision_boundary": "The client must branch on a single test performed *before* merging any replayed event into its working state: - If the first replayed event carries an epoch marker equal to the client's recorded session epoch → resume normally, advance `last_event_id`. - If the epoch marker differs, or no epoch marker is present and the server does not expose one in session ...",
    "operational_effect": "Without the epoch cross-check, the agent silently corrupts its own working state with a replay that *looks* authoritative — the transport succeeded, the events are ordered, the ids are contiguous. The failure is invisible at the transport layer and only manifests as downstream contradiction (two \"final\" results, a progress counter that regresses, a file hash..."
  },
  "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": "e98b22d1f2415707d91c2a56f4286c95afb8bafa19a6e67461306185aeebcb74",
    "verified_classes": [
      "EpochMismatchedReplayError"
    ],
    "verified_functions": [
      "merge_resumable_replay"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "EpochMismatchedReplayError"
    ],
    "sample_fail_closed_invariants": [
      "replay has no epoch marker and gap exceeds session TTL; treating as fresh session, refusing to merge"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
