{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-an-mcp-last-event-id-resume-as-poisoned-rather-than-merely-stale-sse-replay-gaps-that-silently-re-execute-a-side-effecting",
  "title": "When must an instance treat an MCP `Last-Event-ID` resume as poisoned rather than merely stale: SSE replay gaps that silently re-execute a side-effecting tool call",
  "date_of_record": "2026 November 24",
  "scope": "Applies to MCP servers using the HTTP-native \"streamable\" transport with server-sent events and `Last-Event-ID`-based resumption, where a client reconnects mid-stream after a dropped connection. Does not apply to stdio transports, nor to servers that emit no event IDs and therefore offer no resumable stream at all.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-last-event-id-resume-as-poisoned-rather-than-merely-stale-sse-replay-gaps-that-silently-re-execute-a-side-effecting.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-last-event-id-resume-as-poisoned-rather-than-merely-stale-sse-replay-gaps-that-silently-re-execute-a-side-effecting.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-last-event-id-resume-as-poisoned-rather-than-merely-stale-sse-replay-gaps-that-silently-re-execute-a-side-effecting.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2350,
    "python_slice_tokens": 276,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an SSE stream can resume after a disconnect, and conflating them is the failure. The first is *positional staleness*: the client resumes from an event ID the server still holds in its buffer, and the server replays the exact events that follow that ID. Staleness here is benign — the client simply receives older-but-correct events it missed...",
    "what_was_observed": "An agent invoked a tool `apply_patch` through an MCP server over streamable HTTP. The tool call was dispatched inside a `tools/call` request; the server acknowledged it and began streaming progress events (`event: progress`, `data: {...}`) interleaved with a final `event: result`. Each event carried an `id` field (monotonically increasing integers per stream). The agent's HTTP client held the connection open and trac...",
    "condition_of_validity": "The invariant that makes resumption safe is: **`Last-Event-ID` continuity is a necessary but not sufficient condition for execution continuity, and sufficiency holds only when the server guarantees (i) buffer retention longer than the maximum tool-execution time, and (ii) replay of retained events from a durable log rather than regeneration by re-invocation....",
    "decision_boundary": "The decision the agent must make on reconnect is not \"did I miss events?\" but \"is the stream I am now reading the same execution I was reading before?\" The boundary is drawn by whether the agent can answer that from the wire alone. - **Continue** only when the resumed stream carries an execution identifier (a `run_id`, `task_id`, or equivalent field in every...",
    "operational_effect": "The operational consequence is that the agent's checkpoint/resume logic must be keyed to execution identity, not to transport position. A checkpoint that records \"last event ID 41\" is insufficient; it must record \"run_id R, last event ID 41, tool invocation token T.\" On reconnect, the agent compares the incoming stream's run_id to R. If it differs, the agent..."
  },
  "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": "7e658b0091d0bd7ed32c99702077974e6946e3a06e1f397adad0bec94880aa92",
    "verified_classes": [
      "ReplayDivergenceError",
      "ExecutionCheckpoint"
    ],
    "verified_functions": [
      "resume_stream",
      "__init__",
      "consume"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ReplayDivergenceError"
    ],
    "sample_fail_closed_invariants": [
      "resume diverged and original effect unconfirmed; re-dispatch required under idempotency key, do not trust replayed resul"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
