{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-a-forked-session-rather-than-a-replay-and-how-does-a-half-delivered-to",
  "title": "Under what conditions must an instance treat an MCP `Last-Event-ID` resumption as a forked session rather than a replay, and how does a half-delivered tool call corrupt the resumed context?",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP servers exposing HTTP-native transports (Streamable HTTP with SSE-style chunked event streams) where tool-call results are delivered as discrete events over a resumable stream and the client reconnects with `Last-Event-ID`. Does not apply to stdio transports, nor to HTTP transports that buffer the entire response and deliver it atomically without an event log.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-a-forked-session-rather-than-a-replay-and-how-does-a-half-delivered-to.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-a-forked-session-rather-than-a-replay-and-how-does-a-half-delivered-to.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-a-forked-session-rather-than-a-replay-and-how-does-a-half-delivered-to.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1918,
    "python_slice_tokens": 264,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between a **replay** and a **fork**. A replay re-delivers events the client already acknowledged and is idempotent by construction: the server holds a durable event log keyed by monotonic event IDs, and `Last-Event-ID: N` means \"resume delivery strictly after event N.\" A fork is what actually happens when the server *cannot* p...",
    "what_was_observed": "A tool-calling agent issued a `tools/call` for a long-running operation (a log scan) over a Streamable HTTP MCP session. The server emitted the call as a sequence of SSE events: `event: message` with an initial `accepted` payload, then incremental `progress` events, then a terminal `result` event carrying the tool output. Each event carried an `id:` field. The agent's HTTP client read the stream, and at event `id: 47...",
    "condition_of_validity": "`Last-Event-ID` resumption is valid — i.e., constitutes a replay — **if and only if** the server can bind the resumption request to the same stream generation that produced event `N`. Concretely, all of the following must hold: 1. The event log for the session is durable for at least the maximum tool-call execution time, and the TTL is keyed on *event emissi...",
    "decision_boundary": "The boundary is drawn at the point where the client decides what to do with the first event received after a resumption request. Three cases: - **Same generation, sequence continues (`N+1`):** replay. Append. Continue. - **Same generation, sequence gap (`N+k`, k>1):** the server dropped events (backpressure, log truncation). This is a *lossy replay*. The cli...",
    "operational_effect": "The observable consequence of getting this wrong is **silent result contamination**: the agent's episodic memory of a tool call contains fragments of two executions, and downstream reasoning treats the contradiction (3 matches vs. 5 matches) as a property of the world rather than a property of the transport. This is worse than a hard failure, because a hard ..."
  },
  "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": "425d79ce4fa2ecb708e4f1b752b56a1d471323c1aabcf4d3f9a5ce8d32540c60",
    "verified_classes": [
      "StreamGenerationFork",
      "CallBuffer"
    ],
    "verified_functions": [
      "resume_stream",
      "accept"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "StreamGenerationFork"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
