{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-refuse-to-multiplex-tool-calls-across-mcp-sessions-when-the-sse-stream-is-half-open",
  "title": "In what scenarios must an instance refuse to multiplex tool calls across MCP sessions when the SSE stream is half-open",
  "date_of_record": "2026 November 12",
  "scope": "Applies to HTTP-native MCP transports where a single server instance fans multiple client sessions over one process using Server-Sent Events for server-to-client streaming and POST for client-to-server requests. Does not apply to stdio transports, nor to deployments where each session is pinned to a dedicated process/worker with its own event loop.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-multiplex-tool-calls-across-mcp-sessions-when-the-sse-stream-is-half-open.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-multiplex-tool-calls-across-mcp-sessions-when-the-sse-stream-is-half-open.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-multiplex-tool-calls-across-mcp-sessions-when-the-sse-stream-is-half-open.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1259,
    "python_slice_tokens": 245,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The dangerous confusion is between *session liveness* and *stream liveness*. An MCP session is a logical identity carrying negotiated capabilities and a request/response correlation table. An SSE stream is a byte channel that may be half-closed — the client has stopped reading (TCP receive window exhausted, proxy buffering, or a browser tab throttled) — whil...",
    "what_was_observed": "Under a fan-out of ~400 concurrent sessions, a client behind a buffering reverse proxy stopped consuming its SSE stream while continuing to POST `tools/call` requests. The server's per-session outbound queue grew monotonically: each POST produced a JSON-RPC response frame enqueued to the half-open stream. The write loop blocked on the socket, but admission control had no visibility into that block — it only checked `...",
    "condition_of_validity": "Refusal is correct only when all of the following hold: 1. The stream is *half-open*: the session is authenticated and active, but the last N write attempts made zero forward progress within the drain window (e.g., socket send buffer full and no `drain` resolution). 2. The target session's outbound queue is at or above its declared flow-control credit (credi...",
    "decision_boundary": "- **Admit** when drain credit > 0 for the target session's stream, regardless of global load. - **Refuse with backpressure signal** (HTTP 429 with `Retry-After`, or a JSON-RPC error frame if the stream is still writable) when the target session is half-open and at credit zero. Refusal must be *scoped to that session*; do not shed other sessions. - **Tear dow...",
    "operational_effect": "Instances that gate on session existence rather than stream drain credit exhibit head-of-line blocking that propagates through retry amplification into duplicated tool side effects and memory growth that looks like a leak but is actually unbounded per-session queueing. Instances that gate on per-session drain credit convert a global degradation into a locali..."
  },
  "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": "7eedc6a2ec93ac86d55060742625706220c4506be63afe4f39518b252d7a85bb",
    "verified_classes": [
      "HalfOpenStreamRefusal",
      "SessionStream"
    ],
    "verified_functions": [
      "dispatch_tool_call",
      "__init__",
      "is_half_open",
      "admit"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "HalfOpenStreamRefusal"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
