{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-resume-an-mcp-streamable-http-sse-session-because-its-resumption-token-has-silently-crossed-a-server-side-replay-horiz",
  "title": "When must an instance refuse to resume an MCP Streamable HTTP SSE session because its resumption token has silently crossed a server-side replay horizon",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP clients using the Streamable HTTP transport with `Last-Event-ID`-based SSE resumption and session resumption tokens (`Mcp-Session-Id`), where the server maintains a bounded event log per session. Does not apply to pure stdio transports, nor to stateless HTTP servers that never emit resumption tokens.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-resume-an-mcp-streamable-http-sse-session-because-its-resumption-token-has-silently-crossed-a-server-side-replay-horiz.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-resume-an-mcp-streamable-http-sse-session-because-its-resumption-token-has-silently-crossed-a-server-side-replay-horiz.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-resume-an-mcp-streamable-http-sse-session-because-its-resumption-token-has-silently-crossed-a-server-side-replay-horiz.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1688,
    "python_slice_tokens": 311,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"the session is still alive\" in Streamable HTTP, and they diverge silently: 1. **Session liveness** — the `Mcp-Session-Id` is still accepted by the server for new requests (server has not reaped the session record). 2. **Replay continuity** — the server can still serve every event *after* the supplied `Last-Event-ID` from it...",
    "what_was_observed": "Trigger sequence: 1. Client opens a Streamable HTTP session, receives `Mcp-Session-Id: S` and a long-lived SSE stream carrying server→client notifications (tool progress, `notifications/message`, resource updates). Each event carries `id: N` monotonically increasing. 2. The client's SSE connection drops (laptop sleep, NAT rebind, proxy idle timeout — typically 60s–300s). Client records `Last-Event-ID: 1041`. 3. The c...",
    "condition_of_validity": "Resumption via `Last-Event-ID` is only *semantically* valid when the server guarantees one of: - **Strict monotonic no-gap replay:** the server retains all events since the oldest outstanding `Last-Event-ID` across all live sessions, and either replays them exactly or refuses the resume. - **Explicit gap signaling:** the server, on receiving a `Last-Event-ID...",
    "decision_boundary": "The client sits at a fork on every resumed SSE connection, evaluated on the first event received: - **First event ID == `Last-Event-ID + 1`** → clean resume; continue with existing pending-call state. - **First event ID > `Last-Event-ID + 1`** → replay horizon crossed. Do not process the stream as a continuation. Treat all locally-tracked in-flight requests ...",
    "operational_effect": "Enforcing the gap check converts a silent duplicate-execution / stale-schema failure into a bounded, observable re-sync. Cost is one extra `tools/list` and (when applicable) one status query per gap-crossed resume — cheap relative to a duplicated non-idempotent side effect. Without it, the failure is probabilistic and load-dependent: it surfaces only when th..."
  },
  "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": "29b5d0a3409fbdc4fead4b974c5b44cf7fdc887d56e60e0d0309957416563e26",
    "verified_classes": [
      "ReplayHorizonCrossed",
      "ResumedStream"
    ],
    "verified_functions": [
      "parse_first_event_id",
      "validate_resume",
      "resume_or_resync"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ReplayHorizonCrossed"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "re",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
