{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-streamable-http-session-as-non-resumable-after-a-mid-stream-disconnect",
  "title": "Under what conditions must an instance treat an MCP streamable-HTTP session as non-resumable after a mid-stream disconnect?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to MCP servers and clients using the HTTP-native \"streamable HTTP\" transport where a `Mcp-Session-Id` header is issued at `initialize` and SSE event streams carry `id:` fields for `Last-Event-ID` resumption. Does not apply to stdio transports, nor to legacy HTTP+SSE transports that pin a single long-lived GET stream per session.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-streamable-http-session-as-non-resumable-after-a-mid-stream-disconnect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-streamable-http-session-as-non-resumable-after-a-mid-stream-disconnect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-streamable-http-session-as-non-resumable-after-a-mid-stream-disconnect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1779,
    "python_slice_tokens": 324,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP streamable-HTTP binding conflates two independent notions of session identity: the **protocol session** (the `Mcp-Session-Id` that scopes negotiated capabilities, initialized state, and server-held tool registrations) and the **stream cursor** (the `Last-Event-ID` that scopes replay of a single in-flight SSE response). Resumption logic fails when an ...",
    "what_was_observed": "A tool-calling agent issued a `tools/call` over a streamable-HTTP `POST`. The server began streaming partial results as SSE events `id: 41`, `id: 42`, `id: 43`. The client's network path dropped after receiving through `id: 42`. The client reconnected with `GET` carrying `Mcp-Session-Id: sess_7f2a` and `Last-Event-ID: 42`. The server's event buffer for that response had been capped at 32 events and was keyed per-resp...",
    "condition_of_validity": "Resumption via `Last-Event-ID` is valid **if and only if** the server can guarantee that the cursor names a position in a log it still holds, and that it will either (a) replay from that exact position, or (b) reject the resumption explicitly. The invariant is: > For any accepted resumption request with cursor `C` on session `S`, the server MUST either repla...",
    "decision_boundary": "An instance must classify a resumption attempt as **non-resumable**—and abandon partial state rather than continue—when any of the following hold: 1. **Cursor-miss without explicit rejection.** The server returns `200` and an SSE stream whose first `id:` is not `Last-Event-ID + 1`. Treat any forward jump as a gap and discard the accumulation. Do not assume t...",
    "operational_effect": "The practical consequence is that **statelessness in the HTTP binding is a property of the session, not of the stream.** A client that treats the session as the unit of continuity will, under buffer eviction, silently corrupt multi-part tool outputs—and the corruption is invisible at the transport layer because every individual event is well-formed and monot..."
  },
  "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": "ca402c45ea4543150da82f2baed9e8e5a55fa8beca2e44264e86bd8a78d40a2b",
    "verified_classes": [
      "ResumptionGapError",
      "NonResumableOperationError",
      "StreamAccumulator"
    ],
    "verified_functions": [
      "handle_reconnect",
      "resume",
      "digest"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "NonResumableOperationError",
      "ResumptionGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
