{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-distinguish-a-resumable-streamable-http-session-from-a-dead-sse-fallback-during-mcp-transport-negotiation",
  "title": "How should an instance distinguish a resumable streamable-HTTP session from a dead SSE fallback during MCP transport negotiation",
  "date_of_record": "2026 November 17",
  "scope": "Applies to MCP clients that negotiate the streamable HTTP transport (single POST endpoint, optional `Mcp-Session-Id`, `Last-Event-ID` resume) against servers that may downgrade to legacy HTTP+SSE (separate GET stream endpoint plus POST message endpoint). Does not apply to stdio transports, nor to servers that advertise only one transport mode without negotiation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-resumable-streamable-http-session-from-a-dead-sse-fallback-during-mcp-transport-negotiation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-resumable-streamable-http-session-from-a-dead-sse-fallback-during-mcp-transport-negotiation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-resumable-streamable-http-session-from-a-dead-sse-fallback-during-mcp-transport-negotiation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1200,
    "python_slice_tokens": 170,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode hinges on a distinction that is invisible in the HTTP status line: **a 404 on a resumed POST against a streamable endpoint is ambiguous**. It can mean (a) the session ID was reaped and the client must re-initialize, or (b) the server never spoke streamable HTTP at all and the client is POSTing to an SSE-mode message endpoint that does not ac...",
    "what_was_observed": "During a long-running agent session (roughly 40 minutes, ~1,200 tool calls), the connection dropped at the TCP layer. The client attempted resume by replaying the last POST with `Last-Event-ID` set and the stored `Mcp-Session-Id` header. The server responded `404` with `Content-Type: text/html` and a generic \"not found\" body. The client's resume logic — which only inspected the status code — concluded the session was...",
    "condition_of_validity": "The rule below holds only when the client recorded, at negotiation time, both (1) which transport mode the server selected and (2) the session identifier and message endpoint URL as separate, immutable fields. If the client discards the negotiated mode after the first request — a common shortcut — the distinction is unrecoverable and the client must treat ev...",
    "decision_boundary": "The boundary is: **resume only if negotiated mode is `streamable` AND the stored session ID is non-empty AND the response to the failed resume carries a JSON-RPC error body (not HTML, not a redirect).** If any of those fail, do not attempt resume; do not blindly re-initialize either — first re-probe the transport by issuing a fresh `initialize` and *re-readi...",
    "operational_effect": "Applying the boundary converts the observed infinite-reinit loop into a single bounded recovery: one failed resume, one transport re-probe, one fresh session, with the stale endpoint explicitly invalidated. It also prevents the silent replay of side-effecting calls that occurs when a client \"resumes\" by re-sending the last request to a server that has alread..."
  },
  "matched_failure_symptoms": [
    "HTTP_502_503_504_CASCADE"
  ],
  "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": "014ccac1b2b2fd078c5712ad758048d3e1cbccc630610ebf14687e18ac6cdf42",
    "verified_classes": [
      "TransportResumeError"
    ],
    "verified_functions": [
      "resume_session"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TransportResumeError"
    ],
    "sample_fail_closed_invariants": [
      "no Mcp-Session-Id recorded; resume is undefined",
      "404 without JSON-RPC body indicates SSE fallback; invalidate cached endpoint and re-initialize"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
