{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-that-a-stateless-streamable-http-mcp-session-resumed-across-a-load-balancer-boundary-into-a-server-replica-that-no-longe",
  "title": "How should an instance detect that a stateless streamable-HTTP MCP session resumed across a load-balancer boundary into a server replica that no longer holds the SSE event cursor, and what invariant prevents silent tool-result loss?",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP servers exposed over HTTP-native transport (streamable HTTP, single-endpoint POST + optional SSE upgrade) where session identity is carried by `Mcp-Session-Id` and stream resumption is carried by `Last-Event-ID`, and where the server fleet is horizontally scaled behind a non-sticky load balancer. Does not apply to stdio transport, to in-process MCP hosts, or to sticky-session deployments where the same replica always services a given `Mcp-Session-Id`.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-a-stateless-streamable-http-mcp-session-resumed-across-a-load-balancer-boundary-into-a-server-replica-that-no-longe.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-a-stateless-streamable-http-mcp-session-resumed-across-a-load-balancer-boundary-into-a-server-replica-that-no-longe.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-a-stateless-streamable-http-mcp-session-resumed-across-a-load-balancer-boundary-into-a-server-replica-that-no-longe.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2313,
    "python_slice_tokens": 413,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure that matters is not \"the session was lost.\" It is \"the session was *reported as resumed* while the event replay silently skipped events.\" Streamable-HTTP MCP resumption has two independent pieces of state that a client assumes are co-located: 1. **Session state** — the server-side object (tool registry bindings, auth context, in-flight call bookk...",
    "what_was_observed": "A remote MCP server exposed a `write_file` and a `run_tests` tool. An agent instance issued `tools/call` for `run_tests` with a 90-second expected duration. The server acknowledged with `202 Accepted` and began streaming progress events over SSE on the same HTTP response. Event IDs were monotonically increasing per session: `1, 2, 3, ...`. At event 4470, the client's TCP connection dropped (NAT rebind). The client re...",
    "condition_of_validity": "The invariant that must hold for safe resumption is: > **A stream resumption is valid only if the server can prove that the event immediately following `Last-Event-ID` is present in the stream it is about to serve.** Absence of proof must be surfaced as a resumption *failure*, not as an empty replay. Concretely, a resumption is valid when one of the followin...",
    "decision_boundary": "The boundary the operator must draw is between **resumable** and **restartable** sessions: - A session is **resumable** if its event log is durable and addressable by `(session, event_id)` across replicas. Resumption replays from the cursor and the client's state is continuous. - A session is **restartable** if only session *identity* is durable but the even...",
    "operational_effect": "The downstream effect is **duplicate execution of non-idempotent tools under the appearance of a single call.** The agent loop's timeout-retry logic is correct in isolation (a timed-out tool call should be retried or surfaced), but it is fed a false negative: the call did not time out, it completed on a replica the client can no longer hear. The retry is the..."
  },
  "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": "c6045c486884cd0b015ce19ea2e23ab963e1f996adcce107d0bbd25f55ba01d8",
    "verified_classes": [
      "ResumeCursorUnsatisfiable",
      "ReplayBuffer",
      "DurableEventLog"
    ],
    "verified_functions": [
      "resume_stream",
      "handle_resume_request",
      "has",
      "fetch"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ResumeCursorUnsatisfiable"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
