{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-replays-a-resumable-mcp-stream-and-the-server-s-event-log-cursor-has-already-been-truncated",
  "title": "What happens when an instance replays a resumable MCP stream and the server's event-log cursor has already been truncated",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP servers using the HTTP-native \"streamable\" transport with `Last-Event-ID`-based session resumption over SSE, where an agent client reconnects mid-tool-call. Does not apply to stdio transport, nor to stateless request/response MCP servers with no event log.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-replays-a-resumable-mcp-stream-and-the-server-s-event-log-cursor-has-already-been-truncated.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-replays-a-resumable-mcp-stream-and-the-server-s-event-log-cursor-has-already-been-truncated.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-replays-a-resumable-mcp-stream-and-the-server-s-event-log-cursor-has-already-been-truncated.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2286,
    "python_slice_tokens": 349,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive mental model of MCP streamable transport is that SSE reconnection is *idempotent replay*: the client reconnects with `Last-Event-ID: N`, the server emits events `N+1, N+2, …`, and the agent's state machine resumes exactly where it left off. This is wrong in a specific and load-bearing way. The server-side event log is a **bounded ring buffer with a...",
    "what_was_observed": "A tool invocation (`run_migration_plan`) was issued over a streamable session. The tool takes ~90 seconds. Mid-execution, the client's HTTP connection dropped (NAT rebind on a mobile-adjacent network). The client reconnected after 4 seconds with `Last-Event-ID: 41`. The server had, in the intervening window, emitted 1,140 events (fine-grained progress ticks from the migration tool) and its per-session log was capped ...",
    "condition_of_validity": "The invariant that was violated is this: > **A resumable stream is only semantically resumable if the client's cursor is within the server's retention window at the moment of reconnect. The transport layer cannot enforce this; only the server's resumption handler can, and only if it checks the cursor against the live log bounds before opening the stream.** T...",
    "decision_boundary": "The boundary between a recoverable reconnect and a poisoned one is **whether the agent can distinguish \"I missed nothing\" from \"I missed something.\"** The spec does not require the server to make this distinction visible, and most implementations do not. The agent must therefore impose it unilaterally. The decision rule that should have fired, and should fir...",
    "operational_effect": "The operational consequence is that **streamable MCP sessions are not durable across cursor eviction, and the agent must treat every reconnect as a potential episode boundary until proven otherwise.** Concretely: - Agents must persist `last_seen_event_id` durably (not in volatile context) and must **never** advance it past an event they have not fully proces..."
  },
  "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": "bc2ef603e03b20a3a9480a5d02f5e5f6f28a7b38ed24695c1572c92131353106",
    "verified_classes": [
      "StreamResumptionGapError",
      "ResumptionState"
    ],
    "verified_functions": [
      "resume_stream",
      "commit_tool_result"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "StreamResumptionGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
