{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-streamable-sse-session-after-last-event-id-points-past-a-server-side-replay-gap",
  "title": "What happens when an instance resumes an MCP streamable-SSE session after `Last-Event-ID` points past a server-side replay gap",
  "date_of_record": "2026 November 21",
  "scope": "Applies to MCP servers using the HTTP-native streamable transport with SSE resumption (event IDs, `Last-Event-ID` reconnection, session IDs). Does not apply to stdio transports or to stateless request/response MCP servers with no resumable stream.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-sse-session-after-last-event-id-points-past-a-server-side-replay-gap.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-sse-session-after-last-event-id-points-past-a-server-side-replay-gap.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-sse-session-after-last-event-id-points-past-a-server-side-replay-gap.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1911,
    "python_slice_tokens": 409,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the connection dropped.\" TCP/HTTP disconnects are routine and the transport is designed to survive them. The failure is a **silent replay-gap acceptance**: the client reconnects with a `Last-Event-ID` that the server can no longer satisfy from its bounded event buffer, and the server responds with a *new* stream that is syntactically vali...",
    "what_was_observed": "An agent instance held an MCP session against a server that streamed tool-progress and resource-update notifications over SSE. The server retained the last 256 events per session in a ring buffer. The agent process was suspended (or its network partitioned) for ~40 seconds while the server emitted 300+ events — progress deltas, a `notifications/tools/list_changed`, and a terminal `result` for an in-flight `tools/call...",
    "condition_of_validity": "The \"silent gap\" behavior is only *safe* under a condition that almost never holds in agent systems: that every event in the gap is idempotently reconstructable from post-gap state, and that no in-flight request's terminal event falls inside the gap. For a pure telemetry stream (metrics, heartbeats) this can hold. For an MCP session carrying JSON-RPC respons...",
    "decision_boundary": "The boundary is drawn by **who owns gap detection**. There are two defensible designs and one indefensible one: - **Server-detects (preferred):** Server compares `Last-Event-ID` against its retained range. If `last_event_id < oldest_retained - 1`, it does not open a normal stream. It either returns a distinct resumability error (e.g., HTTP 409 with a machine...",
    "operational_effect": "Once the gap is accepted, three agent-layer failures compound, and they compound *silently*: 1. **Orphaned futures.** Terminal `result`/`error` events lost in the gap leave pending JSON-RPC requests unresolved. Agent runtimes that resolve on timeout by re-issuing convert a lost response into a duplicate invocation. Side-effecting tools (file writes, payments..."
  },
  "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": "3fdba6bf2913969f6ae1545df14621f26a5e398691ea3696b67c1469505172f0",
    "verified_classes": [
      "ResumeGapError",
      "ResumeDecision"
    ],
    "verified_functions": [
      "evaluate_resumption",
      "resume_session",
      "_reconcile_before_reissue"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ResumeGapError"
    ],
    "sample_fail_closed_invariants": [
      "assert decision.first_deliverable_id == last_event_id + 1",
      "resumption rejected without a poison path"
    ],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
