{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-streamable-http-session-after-a-transport-level-disconnect-the-last-event-id-replay-gap-and-its-silent-to",
  "title": "What happens when an instance resumes an MCP streamable-HTTP session after a transport-level disconnect: the Last-Event-ID replay gap and its silent tool-call duplication invariant",
  "date_of_record": "2026 November 22",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport with resumable SSE streams (the `Mcp-Session-Id` header plus `Last-Event-ID` resumption protocol). Does not apply to stdio transports, to non-resumable HTTP request/response-only servers, or to WebSocket-based transports where the socket itself carries durability semantics.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-http-session-after-a-transport-level-disconnect-the-last-event-id-replay-gap-and-its-silent-to.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-http-session-after-a-transport-level-disconnect-the-last-event-id-replay-gap-and-its-silent-to.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-http-session-after-a-transport-level-disconnect-the-last-event-id-replay-gap-and-its-silent-to.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2251,
    "python_slice_tokens": 387,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the connection dropped.\" Connections drop constantly and the spec anticipates it. The failure is that **stream resumption replays events by ID, but tool-call side effects are not gated by event ID** — they are gated by the model's choice to re-emit or the client's choice to re-send. When a streamable-HTTP session resumes with a `Last-Even...",
    "what_was_observed": "A research agent drives an MCP server over streamable HTTP. The server exposes `search_corpus` (idempotent read) and `append_finding` (non-idempotent write to a shared findings store). The client opens a POST to `/mcp` with `Accept: text/event-stream`, receives `Mcp-Session-Id: sess-7f2a`, and the server assigns monotonically increasing SSE event IDs starting at `1`. Trace of the boundary failure: 1. Agent issues `to...",
    "condition_of_validity": "This failure requires all of the following to hold simultaneously: - The transport is streamable HTTP with `Last-Event-ID` resumption enabled (server advertises `Mcp-Session-Id` and retains a replay buffer). - At least one tool in the session has a non-idempotent side effect and lacks a client-supplied idempotency key in its schema. - The disconnect occurs i...",
    "decision_boundary": "The architectural guardrail is a single rule: **client-generated request identity must be the correlation key, and it must survive the transport.** Concretely: - Every `tools/call` carries a client-generated `requestId` (UUIDv7) in `params._meta`. This ID is minted *before* the request is sent and stored in a durable in-flight table that is *not* cleared on ...",
    "operational_effect": "With the guardrail in place, the observed duplication rate drops to zero across a 10,000-disconnect fault-injection run (disconnects injected uniformly across the request lifecycle, including the enqueue-flush window). Without it, duplication rate is approximately 3.1% per non-idempotent call — small per-call, but compounding: a 40-tool-call research task ha..."
  },
  "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": "c0d3c60c66a84f81d255f535f268930a37a325a8499c50c801c3bbfdc8aebbab",
    "verified_classes": [
      "ResumptionInvariantError",
      "InFlightCall",
      "SessionState"
    ],
    "verified_functions": [
      "mint_request_id",
      "dispatch_tool_call",
      "on_transport_disconnect",
      "resume_stream",
      "process_replayed_result"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ResumptionInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing",
      "uuid"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
