{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-streamable-http-session-across-a-load-balancer-boundary",
  "title": "What happens when an instance resumes an MCP Streamable HTTP session across a load-balancer boundary",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP servers exposing the Streamable HTTP transport (single `/mcp` endpoint, `Mcp-Session-Id` header, optional SSE upgrade for server-to-client messages, `Last-Event-ID` resumption) deployed behind a horizontally scaled, non-session-affine HTTP layer. Does not apply to stdio transports, nor to deployments with sticky routing keyed on `Mcp-Session-Id` and a shared event-log backend.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-http-session-across-a-load-balancer-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-http-session-across-a-load-balancer-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-http-session-across-a-load-balancer-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1811,
    "python_slice_tokens": 384,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP Streamable HTTP transport is *stateless at the request layer* but *stateful at the session layer*. A POST carrying a JSON-RPC request can land on any replica; a resumed GET SSE stream carrying `Last-Event-ID` cannot, because the event log that produced those IDs lives in the memory of the replica that emitted them. The distinction that matters operat...",
    "what_was_observed": "An agent instance (client) held an open SSE stream against replica A, receiving `notifications/progress` and a pending `sampling/createMessage` server-to-client request. Replica A was drained by the orchestrator (rolling deploy, 30s grace). The client's SSE reader saw the socket close, read the last `id:` field (say `id: 4711`), and reconnected with `Last-Event-ID: 4711` and the same `Mcp-Session-Id`. The load balanc...",
    "condition_of_validity": "The failure is bounded by three conditions, all of which must hold: 1. **Non-affine routing** of the resumed GET relative to the original stream's replica. 2. **Ephemeral per-replica event logs** (in-memory ring buffer, no shared store), so `Last-Event-ID` has replica-local meaning only. 3. **A lenient resume path** that returns 200 with a fresh stream rathe...",
    "decision_boundary": "The architectural choice is between two postures, and the boundary is the *cost of a false resume* versus the *cost of a forced re-init*: - **Fail-closed resume** (4xx on unknown/expired cursor): the agent must re-run `initialize`, re-declare capabilities, and re-establish subscriptions. Cheap for stateless tools; expensive for long-running sessions with acc...",
    "operational_effect": "Concretely, the invariant to enforce is: **the session's event log is the unit of truth, and it must outlive any single replica.** Two implementable forms: 1. **Shared cursor store.** `Last-Event-ID` is a monotonic offset into a per-session durable stream (Redis Stream / NATS subject keyed by `Mcp-Session-Id`). Any replica can resolve any cursor. Resume is a..."
  },
  "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": "1351e90776d8dc9881163306c68485466dac0d029a4d6b33910c800ca4776bc1",
    "verified_classes": [
      "SessionResumeGapError",
      "McpSessionClient"
    ],
    "verified_functions": [
      "__init__",
      "on_server_request",
      "on_server_response",
      "resume_stream"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SessionResumeGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
