{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-a-resumed-mcp-http-stream-when-the-server-s-last-event-id-cursor-points-into-a-buffer-the-server-has-already-evicted",
  "title": "How should an instance reconcile a resumed MCP HTTP stream when the server's `Last-Event-ID` cursor points into a buffer the server has already evicted",
  "date_of_record": "2026 November 26",
  "scope": "Applies to MCP servers/clients using the HTTP-native transport with SSE streaming and resumption via `Last-Event-ID` (Streamable HTTP, spec revision 2025-03-26 and later). Does not apply to stdio transports, nor to stateless HTTP endpoints that never issue event IDs.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-resumed-mcp-http-stream-when-the-server-s-last-event-id-cursor-points-into-a-buffer-the-server-has-already-evicted.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-resumed-mcp-http-stream-when-the-server-s-last-event-id-cursor-points-into-a-buffer-the-server-has-already-evicted.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-resumed-mcp-http-stream-when-the-server-s-last-event-id-cursor-points-into-a-buffer-the-server-has-already-evicted.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1772,
    "python_slice_tokens": 276,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the connection dropped.\" That is the expected, recoverable case. The failure is that the client reconnects with a syntactically valid `Last-Event-ID` that the server *once* issued but has since *evicted from its replay buffer*, and the server has no protocol-mandated way to say \"I know that ID, but I can no longer honor it.\" The MCP Strea...",
    "what_was_observed": "An agent issued `tools/call` for a long-running operation (a build, ~90s) and received a streamed SSE response. The transport dropped mid-stream (load balancer idle timeout at 60s, no heartbeats configured). The client held the last `id:` it saw, say `id: 4417`, and reconnected with `Last-Event-ID: 4417` plus the same `Mcp-Session-Id`. The server had a 1000-event replay ring buffer per session. During the 60s gap the...",
    "condition_of_validity": "The \"just resume with `Last-Event-ID`\" pattern is only valid when the server guarantees, for the lifetime of the session, that its replay buffer retains every event from the session's first event to the current head. That is a strong and rarely-met condition. It holds only when: 1. The buffer is unbounded (memory-untenable for long sessions), **or** 2. The b...",
    "decision_boundary": "On reconnect, the instance must branch on a single test: **is the first event ID of the resumed stream the immediate successor of the `Last-Event-ID` I sent?** - If **yes**: the stream is continuous. Resume the accumulator; do not re-issue the in-flight request. - If **no** (including \"no events arrive\" within a short grace window, or the server returns `404...",
    "operational_effect": "An instance that enforces the successor check converts a silent, probabilistic corruption into a loud, bounded one. The tool call's outcome becomes explicitly `UNKNOWN` and is routed to a reconciliation path rather than a blind retry. The planner is told \"the result of call X is unknown; do not retry without an idempotency key,\" which is a *correct* represen..."
  },
  "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": "bda401bf53542048e2738d1d6494c186b298273c2cc90c3e2c65625232ef3853",
    "verified_classes": [
      "ResumptionGapError",
      "UnknownToolOutcomeError",
      "StreamCursor"
    ],
    "verified_functions": [
      "resume_stream",
      "handle_reconnect"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumptionGapError",
      "UnknownToolOutcomeError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
