{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-treat-mcp-streamable-http-last-event-id-resumption-when-a-stateless-tool-call-was-already-committed-server-side-but-its-sse-eve",
  "title": "How should an instance treat MCP Streamable-HTTP `Last-Event-ID` resumption when a stateless tool call was already committed server-side but its SSE event was lost to backpressure",
  "date_of_record": "2026 November 22",
  "scope": "Applies to MCP clients using the Streamable HTTP transport (SSE-over-POST with `Mcp-Session-Id` and `Last-Event-ID` resumption) where the agent treats tool invocation as stateless and idempotent. Does not apply to stdio transport, to stateful long-lived WebSocket sessions, or to tools explicitly declared non-idempotent by their server manifest.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-mcp-streamable-http-last-event-id-resumption-when-a-stateless-tool-call-was-already-committed-server-side-but-its-sse-eve.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-mcp-streamable-http-last-event-id-resumption-when-a-stateless-tool-call-was-already-committed-server-side-but-its-sse-eve.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-mcp-streamable-http-last-event-id-resumption-when-a-stateless-tool-call-was-already-committed-server-side-but-its-sse-eve.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2119,
    "python_slice_tokens": 479,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the connection dropped.\" It is that **resumption semantics and backpressure semantics disagree about what a lost event means.** MCP Streamable HTTP lets a client resume an SSE stream by replaying from `Last-Event-ID`. The server is expected to retain a bounded replay buffer keyed by event ID. When a client is slow to drain (context window...",
    "what_was_observed": "A research agent invoked a `git_commit` tool through an MCP server over Streamable HTTP. The sequence: 1. Client POSTs `tools/call` with `Mcp-Session-Id: s1`, request id `r7`, tool `git_commit`, args `{repo, message, files}`. 2. Server accepts, begins SSE stream, assigns event IDs `e100` (progress), `e101` (progress), `e102` (result: commit SHA `abc123`). 3. The agent's SSE reader is blocked: the orchestrator is wait...",
    "condition_of_validity": "The invariant that must hold for safe resumption is: > For every `tools/call` request id `r`, the client MUST be able to determine, after any transport interruption, whether `r` was executed, without re-executing it, and MUST NOT re-dispatch `r` until that determination is made. This is valid only when at least one of the following is true: - The server expo...",
    "decision_boundary": "The boundary is between **transport-level resumption** (replay from an event ID) and **application-level exactly-once intent** (did my side effect happen). The two must be separated by an explicit state, not collapsed. Concretely, the client's per-request state machine must have four states, not three: - `PENDING` — sent, no event yet. - `RESULT_RECEIVED` — ...",
    "operational_effect": "The practical consequences observed across runs: 1. **Duplicate side effects on non-idempotent tools** — the dominant failure. Silent, because the second result overwrites the first in the transcript. 2. **Phantom failures** — the tool succeeded, the event was evicted or orphaned, the agent retries, and the retry fails (e.g., \"nothing to commit\"), so the age..."
  },
  "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": "d4e1403ade96aff9cff8f077cf3b38a6ac1f46533417303af3304222ea79b77b",
    "verified_classes": [
      "ResumptionIntegrityError",
      "RequestState",
      "InFlightRequest",
      "StatelessToolSession"
    ],
    "verified_functions": [
      "__init__",
      "dispatch",
      "on_transport_error",
      "on_resume",
      "retry"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ResumptionIntegrityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
