{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-sse-channel-reconnects-between-last-event-id-delivery-and-the-in-flight-req",
  "title": "Why does an instance lose tool-call continuity when an MCP Streamable-HTTP SSE channel reconnects between `Last-Event-ID` delivery and the in-flight request being replayed?",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP servers using the Streamable HTTP transport where a single session multiplexes client→server JSON-RPC requests against a server→client SSE stream carrying responses and notifications, and where the client resumes via `Last-Event-ID` after transport drop. Does not apply to stateless stdio transports, nor to pure request/response HTTP without an SSE channel.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-sse-channel-reconnects-between-last-event-id-delivery-and-the-in-flight-req.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-sse-channel-reconnects-between-last-event-id-delivery-and-the-in-flight-req.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-continuity-when-an-mcp-streamable-http-sse-channel-reconnects-between-last-event-id-delivery-and-the-in-flight-req.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2319,
    "python_slice_tokens": 446,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the connection dropped.\" It is that **resumption and replay are two different clocks that the transport spec lets drift apart**. `Last-Event-ID` resumption replays the *notification/response event log* from a cursor, but it does not replay the *inbound request* that was in flight when the stream broke. The server, on reconnect, considers ...",
    "what_was_observed": "A single-session agent loop issuing `tools/call` over Streamable HTTP. The sequence under load: 1. Client sends `POST /mcp` with JSON-RPC `tools/call` (id `c-4417`), carrying `Mcp-Session-Id`. Server accepts, begins executing a tool with an external side effect (an append to a remote ledger), and streams a `202 Accepted` with an SSE channel. 2. Server commits the side effect at T+0. Server writes the JSON-RPC respons...",
    "condition_of_validity": "The invariant \"SSE resumption preserves tool-call continuity\" holds only when **all three** of the following are true: - **(A) Effect-before-event ordering is atomic.** The server must commit the tool side effect and append the response event to the session buffer in a single durable step (same transaction, or event-append-then-effect with a compensating rol...",
    "decision_boundary": "The agent runtime must decide, on stream drop with pending requests, between **replay-wait** and **retry**, and the correct choice depends on a fact the runtime does not have: whether the side effect committed. The boundary is: - If the transport can prove the response event exists past the cursor (server advertises a `resume-token` or a `GET /mcp/sessions/{...",
    "operational_effect": "The downstream consequences compound in ways that look like reasoning failures but are transport artifacts: - **Duplicate ledger entries, double-sent emails, double-charged cards** — the direct effect, and the one that gets noticed. - **Error compounding in multi-step loops**: the agent sees two responses for what it believes is one call (the replayed `c-441..."
  },
  "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": "04085e33a8a812ca76b5fd5dc84f43c4f61d347b2e27eec3a40ccdd67c9bce91",
    "verified_classes": [
      "ResumptionContinuityError",
      "PendingCall",
      "SessionState"
    ],
    "verified_functions": [
      "make_idempotency_key",
      "on_stream_drop",
      "advance_cursor",
      "resume"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumptionContinuityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
