{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-bound-sse-fallback-negotiation-when-an-mcp-streamable-http-transport-silently-degrades-to-a-half-open-event-stream",
  "title": "Where must an instance bound SSE fallback negotiation when an MCP streamable-HTTP transport silently degrades to a half-open event stream",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP clients and servers negotiating the streamable-HTTP transport where a server may respond to a POST `initialize`/`tools/call` with either a single JSON body or a `text/event-stream`, and where the client may fall back from streaming to SSE mid-session. Does not cover stdio transport, WebSocket transports, or pure request/response MCP servers that never emit `text/event-stream`.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-sse-fallback-negotiation-when-an-mcp-streamable-http-transport-silently-degrades-to-a-half-open-event-stream.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-sse-fallback-negotiation-when-an-mcp-streamable-http-transport-silently-degrades-to-a-half-open-event-stream.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-sse-fallback-negotiation-when-an-mcp-streamable-http-transport-silently-degrades-to-a-half-open-event-stream.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1796,
    "python_slice_tokens": 263,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the SSE fallback broke.\" It is that **transport-mode selection is negotiated per-request but session state is assumed per-connection.** In a streamable-HTTP MCP server, a single logical session (identified by `Mcp-Session-Id`) may serve request A as `application/json` and request B as `text/event-stream`, and a client's fallback logic is ...",
    "what_was_observed": "A tool-calling agent issued `tools/call` for a long-running operation. The server's first response to `initialize` was `application/json` (single body, session established, `Mcp-Session-Id` returned). The subsequent `tools/call` was answered with `200 OK`, `Content-Type: text/event-stream`, `Cache-Control: no-cache`, and `Connection: keep-alive`. The client's transport layer saw the SSE content type and entered its s...",
    "condition_of_validity": "The half-open read only manifests when **all** of the following hold: - The server uses request-scoped SSE (stream closes after terminal frame) rather than connection-scoped SSE (stream persists across requests). The streamable-HTTP spec permits the former; many servers implement it. - The client's fallback path was authored against the connection-scoped mod...",
    "decision_boundary": "The boundary the client must enforce is: **treat SSE stream termination (EOF) as a terminal state for the request that owns that response, and never reuse a reader across requests unless the server has explicitly declared connection-scoped streaming via a negotiated capability.** Concretely, the client's transport state machine must have: - A transition `STR...",
    "operational_effect": "Without the invariant, the agent experiences **non-deterministic tool-result misattribution** that is indistinguishable from a model reasoning error. The agent sees a plausible tool result, but it belongs to a different call. Downstream, this corrupts the agent's episodic memory: the trace records \"call X returned Y\" when Y was the result of call X+1. On res..."
  },
  "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": "bb9e73de452552bfd44cd97e367860556cd5f592fec848c175f564da03392942",
    "verified_classes": [
      "HalfOpenStreamError",
      "RequestScopedSSEReader"
    ],
    "verified_functions": [
      "dispatch_tool_result",
      "__init__",
      "read_event",
      "mark_terminal"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "HalfOpenStreamError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "http",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
