{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-of-an-mcp-client-silently-replay-a-stale-tool-call-after-sse-to-streamable-http-session-resumption",
  "title": "Why does an instance of an MCP client silently replay a stale tool call after SSE-to-streamable-HTTP session resumption?",
  "date_of_record": "2026 November 25",
  "scope": "Applies to MCP clients and servers that have migrated from the legacy HTTP+SSE transport (dual-endpoint: GET `/sse` for the event stream, POST `/messages` for client→server) to the streamable-HTTP transport with `Mcp-Session-Id` resumption. Does *not* apply to stdio transports, nor to fresh sessions with no prior `Last-Event-ID` history.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-of-an-mcp-client-silently-replay-a-stale-tool-call-after-sse-to-streamable-http-session-resumption.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-an-mcp-client-silently-replay-a-stale-tool-call-after-sse-to-streamable-http-session-resumption.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-an-mcp-client-silently-replay-a-stale-tool-call-after-sse-to-streamable-http-session-resumption.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2161,
    "python_slice_tokens": 346,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The legacy SSE transport and the streamable-HTTP transport both carry an `Mcp-Session-Id`, but they disagree on what that identifier *means* for replay. In SSE, the session ID scoped a long-lived GET stream whose `Last-Event-ID` header let the client resume an *event cursor* — the server replayed events after a sequence number, and the client's own request b...",
    "what_was_observed": "A client agent running a `filesystem.write_file` tool call over streamable-HTTP issued `POST /mcp` with `Mcp-Session-Id: s-7f3a` and a JSON-RPC body for `tools/call` with `id: 42`. The server began executing, emitted two SSE frames (`notifications/progress`), then the TCP connection was severed by an intermediary (a 30s idle timeout on a load balancer that did not honor the server's keepalive comment frames). The cli...",
    "condition_of_validity": "The invariant that prevents this is: **a streamable-HTTP resume must be a replay of *events only*, never a re-execution of the request handler, and the client must not re-send the JSON-RPC body on resume.** Concretely, the server must maintain, per session, a map from `(Mcp-Session-Id, JSON-RPC id)` to a terminal-or-in-progress execution record, and on a POS...",
    "decision_boundary": "The boundary between safe resume and duplicate execution is crossed at the moment the client's transport layer decides whether the re-issued POST is a *transport retry* or a *new invocation*. Three regimes: - **Pure transport retry (safe):** client re-sends the POST with `Last-Event-ID` and *no* JSON-RPC body, or with a body whose `id` the server recognizes ...",
    "operational_effect": "After this was diagnosed, the server was changed to write an `executing` record keyed on `(Mcp-Session-Id, JSON-RPC id)` to the same store as the event log, in a single transaction, before invoking any tool handler. On a POST carrying `Last-Event-ID`, the server now looks up the record: if present and complete, it replays events 3..N and returns without invo..."
  },
  "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": "bd4c15f891267fe967362c27045a248235d37a21b3a5813ff1bfd1985be26fd2",
    "verified_classes": [
      "DuplicateExecutionOnResume",
      "ExecutionRecord",
      "ResumeGuard"
    ],
    "verified_functions": [
      "__init__",
      "__init__",
      "begin",
      "resume"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "DuplicateExecutionOnResume"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
