{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-split-brain-sse-stream-when-an-mcp-session-resumes-on-a-second-http-node-mid-tool-call",
  "title": "How does an instance detect a split-brain SSE stream when an MCP session resumes on a second HTTP node mid-tool-call",
  "date_of_record": "2026 December 2",
  "scope": "Applies to MCP servers using the HTTP-native streamable transport (Streamable HTTP, `text/event-stream` responses with `Mcp-Session-Id` and `Last-Event-ID` resumption) where session state may migrate across load-balanced nodes. Does not apply to stdio transport, nor to single-node deployments where session affinity is guaranteed by the process boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-split-brain-sse-stream-when-an-mcp-session-resumes-on-a-second-http-node-mid-tool-call.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-split-brain-sse-stream-when-an-mcp-session-resumes-on-a-second-http-node-mid-tool-call.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-split-brain-sse-stream-when-an-mcp-session-resumes-on-a-second-http-node-mid-tool-call.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2350,
    "python_slice_tokens": 321,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two categorically different meanings of \"resume\" in MCP Streamable HTTP, and conflating them produces a silent correctness failure: 1. **Event replay resume** — the client reconnects with `Last-Event-ID: N` and the server replays buffered SSE events from `N+1`. This is a *transport* guarantee about the byte stream. 2. **Session state resume** — the...",
    "what_was_observed": "A multi-step agent invoked a long-running MCP tool (`run_migration_plan`, ~90s of wall time, streaming progress events). The client's HTTP connection to node A dropped at t≈40s (a routine LB idle-timeout reset on a NAT boundary, not a server crash). The client reconnected per spec: The LB routed to node B. Node B's session store held the *event log* for `7f3c2a...` (replicated, cheap) but not the *execution handle* (...",
    "condition_of_validity": "The split-brain is only possible when all of the following hold simultaneously. Each is a necessary condition; removing any one bounds the failure: - **C1 — Event log and execution handle are decoupled in durability.** The SSE event buffer is replicated/shared across nodes; the tool execution handle is node-local. This is the default outcome of \"just put a s...",
    "decision_boundary": "The server, on receiving a resumed `GET /mcp` with `Last-Event-ID: N`, must make a binary decision before writing a single byte to the stream: - **If the replay buffer contains a terminal event for the in-flight call with `id > N`:** replay through the terminal event and close the stream. This is safe on any node, because the execution is already done and th...",
    "operational_effect": "Concretely, the unguarded system exhibits: - **Silent double-execution** of non-idempotent tools (the migration ran twice). No error at the MCP layer; the client's second `tools/call` is a fresh request with a fresh call id, so server-side dedup keyed on call id does not catch it. - **Frozen progress streams** that pass liveness checks (bytes flow, keepalive..."
  },
  "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": "2e82972869a4c738b8853e8c854492719403a3bca312822a132af0d1caf619f1",
    "verified_classes": [
      "SessionMigrationConflict",
      "SessionLease"
    ],
    "verified_functions": [
      "open_resumed_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SessionMigrationConflict"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
