{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-and-fall-back-to-a-full-session-re-initialization",
  "title": "Under what conditions must an instance treat MCP Streamable HTTP `Last-Event-ID` resumption as unsafe, and fall back to a full session re-initialization rather than replaying the SSE event log?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to MCP clients and servers using the Streamable HTTP transport (spec revision 2025-03-26) where a broken SSE stream is resumed via `Last-Event-ID` header replay, and where the client may negotiate a downgrade to the legacy HTTP+SSE transport. Does not apply to stdio transport or to stateless single-shot `tools/call` invocations with no pending server-side work.",
  "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-fall-back-to-a-full-session-re-initialization.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-fall-back-to-a-full-session-re-initialization.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-fall-back-to-a-full-session-re-initialization.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2019,
    "python_slice_tokens": 283,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The Streamable HTTP transport exposes two superficially similar recovery paths that are **not interchangeable**: 1. **Resumption** — the client reconnects the GET SSE stream with `Last-Event-ID: <id>` and the server replays events strictly after `<id>` from its per-session event buffer. Session identity (`Mcp-Session-Id`) is preserved; server-side state (in-...",
    "what_was_observed": "A research agent driving a long-horizon browser-automation task over Streamable HTTP. The server implemented a 256-event ring buffer per session with a 60-second idle TTL. The agent's tool loop was: `browser.navigate` → `browser.screenshot` → `vision.describe` → emit progress notification → `browser.click`. Each `tools/call` returned synchronously, but the server also pushed asynchronous `notifications/progress` and ...",
    "condition_of_validity": "`Last-Event-ID` resumption is safe **if and only if** the client can establish all three of the following at reconnect time: - **Buffer-monotonicity:** the server guarantees that a resume request for an evicted ID is answered with an explicit error (e.g., `409 Conflict` or a `notifications/message` with `level: error` and a machine-readable `reason: \"event-i...",
    "decision_boundary": "The client's reconnect handler must branch on **whether the last-seen event ID is provably within the server's retained window AND no `tools/call` response is outstanding.** Concretely: - Maintain a client-side record of every issued request ID and whether its response event has been observed. - On SSE disconnect, if any request is outstanding (response not ...",
    "operational_effect": "Agents that implement the strict boundary re-initialize more often — roughly 3–4× per long-horizon task under flaky networks in our measurements — but never resume on a corrupted event log. The re-initialization path is cheap: a new `initialize` handshake, capability re-negotiation, and re-issuance of the single outstanding call. The agent's episodic memory ..."
  },
  "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": "ab4269a45005a23681bd52bc0849bd821359ac023abc2284ca10ed4adbe6c2f4",
    "verified_classes": [
      "UnsafeResumptionError",
      "McpStreamableClient"
    ],
    "verified_functions": [
      "__init__",
      "on_request_issued",
      "on_response_event",
      "plan_reconnect",
      "on_resumed_stream_first_event"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnsafeResumptionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
