{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-to-resume-an-mcp-stream-session-after-a-last-event-id-replay-gap",
  "title": "Under what conditions must an instance refuse to resume an MCP stream session after a `Last-Event-ID` replay gap?",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP clients and servers using HTTP-native streaming transport (SSE or chunked streaming) with `Last-Event-ID`-based session resumption across a reconnecting client instance. Does not apply to stdio transport, to stateless request/response MCP calls, or to resumption where the server retains a complete, gap-free event log keyed by monotonic per-session sequence numbers.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-resume-an-mcp-stream-session-after-a-last-event-id-replay-gap.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-resume-an-mcp-stream-session-after-a-last-event-id-replay-gap.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-resume-an-mcp-stream-session-after-a-last-event-id-replay-gap.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2119,
    "python_slice_tokens": 267,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *transport-level reconnect success* and *session-level semantic continuity*. An SSE reconnect that returns HTTP 200 and a well-formed event stream is not evidence that the client's reconstructed view of the session matches the server's. The `Last-Event-ID` header is a hint, not a contract: the spec requires the server ...",
    "what_was_observed": "A client instance executing a multi-step tool-use loop over MCP HTTP streaming lost its TCP connection mid-session (NAT rebind, not a server fault). The session had issued event IDs `e100` through `e147`; the client had acknowledged through `e131` and had one in-flight `tools/call` whose result was expected as `e132`. On reconnect the client sent `Last-Event-ID: e131`. The server had restarted 40 seconds earlier unde...",
    "condition_of_validity": "Resumption is only semantically valid when **all** of the following hold simultaneously. If any is unverifiable by the client, resumption must be treated as unsafe: 1. **Epoch identity is bound to the session, not the process.** The session carries an opaque epoch/generation token (e.g., a UUID minted at session creation and echoed in every event, or a serve...",
    "decision_boundary": "The decision is not \"did the reconnect succeed?\" but \"can I prove the resume point is exactly my last-seen event?\" Concretely: - **Resume** only if the first event received after reconnect carries an epoch token matching the pre-disconnect epoch **and** a sequence/ID that the client can verify is exactly `last_seen + 1` (dense) or is accompanied by a `resume...",
    "operational_effect": "Enforcing this boundary changes three things in a running agent: First, it converts a class of silent corruption into a visible, recoverable event. The agent's step loop must distinguish \"event received\" from \"expected event received\" — progress is not any event, it is the *specific* event that resolves the current pending operation. A resumed stream that de..."
  },
  "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": "c5823de425a2cb0967c137d263078f9cbcf76aac057cd5662b725c8cc44fb374",
    "verified_classes": [
      "UnsafeResumeError",
      "SessionEpoch",
      "ResumeHandshake"
    ],
    "verified_functions": [
      "decide_resume"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "UnsafeResumeError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
