{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-and-re-establish-a-fresh-session",
  "title": "Under what conditions must an instance treat MCP Streamable-HTTP `Last-Event-ID` resumption as unsafe and re-establish a fresh session",
  "date_of_record": "2026 November 25",
  "scope": "Applies to MCP clients and servers using the Streamable HTTP transport (single POST endpoint, optional SSE upgrade, `Last-Event-ID` resumption, `Mcp-Session-Id` header). Does not apply to stdio transport or to the deprecated HTTP+SSE dual-endpoint transport, where session identity is bound to the connection lifetime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-and-re-establish-a-fresh-session.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-and-re-establish-a-fresh-session.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-and-re-establish-a-fresh-session.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2037,
    "python_slice_tokens": 409,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The Streamable HTTP transport defines resumption as *event-stream replay*, not *session-state replay*. When a client reconnects with `Last-Event-ID: N`, the server is obligated only to re-emit SSE events numbered after `N`; it is **not** obligated to reconstruct the in-flight JSON-RPC request that produced those events, nor to preserve the server-side handle...",
    "what_was_observed": "A client agent issued a `tools/call` for a long-running operation (`repo_index`, ~90s) over a POST that upgraded to SSE. The server emitted: At ~40s the TCP connection was reset by an intermediate proxy (idle-read timeout on the client's half, not the server's). The client reconnected with `Last-Event-ID: 42` and the `Mcp-Session-Id` header intact. The server accepted the resume and replayed from event 43 onward. The...",
    "condition_of_validity": "`Last-Event-ID` resumption is safe **only** when all of the following hold simultaneously: 1. **Handler identity is pinned to the session, not the connection.** The server must be able to prove, on resume, that the handler that produced event `N` is the same handler still producing events. A server that re-dispatches on resume must *advertise* this (e.g., a ...",
    "decision_boundary": "The boundary is *not* \"did the connection drop\" — drops are routine. The boundary is **\"can the client distinguish a replayed execution from a re-dispatched execution using only the data it retained?\"** - If the client retained full progress payloads and the server's resume path is replay-only, resume is safe: divergence in payload content at the same ID is ...",
    "operational_effect": "Treating resumption as unconditional produces three failure classes, all silent: 1. **Double-execution of side-effecting tools.** The re-dispatched handler runs the tool a second time; the client believes it saw one execution. Mitigation: idempotency keys on every `tools/call`, honored server-side across re-dispatch, and rejected (not re-run) on duplicate ke..."
  },
  "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": "1f69c18a8f054cb2ecfc6851d8410769e90e6302deaec211d2fa760ece616f63",
    "verified_classes": [
      "ResumptionUnsafeError",
      "StreamResumeGuard"
    ],
    "verified_functions": [
      "resume_or_restart",
      "__init__",
      "validate_resume"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumptionUnsafeError"
    ],
    "sample_fail_closed_invariants": [
      "cannot verify replay vs re-dispatch: progress payloads were discarded and tool has side effects; open fresh session"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
