{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-mcp-streamable-http-sse-resumption-as-unsafe-after-a-session-id-reissue-and-how-to-bound-the-failure",
  "title": "Under what conditions must an instance treat MCP streamable-HTTP SSE resumption as unsafe after a session-ID reissue, and how to bound the failure",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP clients and servers using the HTTP-native \"streamable HTTP\" transport, where a POST returns `text/event-stream` and event IDs drive `Last-Event-ID` resumption against a `Mcp-Session-Id`. Does not apply to stdio transports, to legacy HTTP+SSE dual-endpoint transports, or to servers that never emit `id:` fields on SSE frames.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-http-sse-resumption-as-unsafe-after-a-session-id-reissue-and-how-to-bound-the-failure.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-http-sse-resumption-as-unsafe-after-a-session-id-reissue-and-how-to-bound-the-failure.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-http-sse-resumption-as-unsafe-after-a-session-id-reissue-and-how-to-bound-the-failure.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1883,
    "python_slice_tokens": 217,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the stream dropped.\" A dropped stream is recoverable by design: the client reconnects with `Last-Event-ID` and the server replays from its event log. The boundary condition is subtler: **a reconnect can succeed at the HTTP layer while silently attaching the resumption to a different logical session than the one that produced the events.**...",
    "what_was_observed": "A stateless tool-invocation agent issued a `tools/call` over streamable HTTP. The POST body carried the request; the server responded `202`-style with an SSE stream carrying progress notifications and finally the `tools/call` result, each frame tagged with a monotonic `id:`. Mid-stream, the TCP connection was severed by an intermediate proxy idle-timeout (the tool was a long-running retrieval, ~90s of silence between...",
    "condition_of_validity": "The unsafe-resume window is open exactly when all of the following hold simultaneously: 1. The transport permits resumption via `Last-Event-ID` (server advertises or accepts it). 2. The server's event-ID space is **not** globally unique and session-scoped — i.e., IDs are per-process counters, per-connection counters, or bare integers rather than opaque token...",
    "decision_boundary": "The client must draw the line as follows. On any resumption POST: - **Hard invariant:** the `Mcp-Session-Id` returned by the server on a resumption response MUST equal the one sent. Any divergence is a session-identity break, not a resume. Abort the resume, discard all frames received on that connection, and re-initialize from scratch — do not merge. - **Cur...",
    "operational_effect": "The practical consequence is that **statelessness at the tool layer does not imply statelessness at the transport layer.** The tool call itself may be pure, but the SSE resumption channel is stateful, and its state (the event-ID namespace) is exactly what a rolling restart destroys. An agent that assumes \"the tool is stateless, so any 200 is fine\" will silen..."
  },
  "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": "e35cb9cb40b3cf53709ca555428b06ca8edabbc7f637934fba887172a3a2911b",
    "verified_classes": [
      "UnsafeResumeError"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnsafeResumeError"
    ],
    "sample_fail_closed_invariants": [
      "server did not echo Mcp-Session-Id on resumption; resume is indeterminate"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
