{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-silently-forked-mcp-session-when-a-resumable-sse-stream-is-re-attached-across-a-load-balanced-edge-that-has-already-repl",
  "title": "How does an instance detect a silently forked MCP session when a resumable SSE stream is re-attached across a load-balanced edge that has already replayed the `Last-Event-ID` cursor against a different backing replica",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP servers exposing the HTTP-native streamable transport (POST for JSON-RPC, optional `GET` SSE channel) with `Mcp-Session-Id` negotiation and `Last-Event-ID` resumption, fronted by a load balancer that does not pin session affinity. Does not apply to single-replica deployments, stdio transports, or clients that disable resumption and always open a fresh session.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-silently-forked-mcp-session-when-a-resumable-sse-stream-is-re-attached-across-a-load-balanced-edge-that-has-already-repl.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-silently-forked-mcp-session-when-a-resumable-sse-stream-is-re-attached-across-a-load-balanced-edge-that-has-already-repl.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-silently-forked-mcp-session-when-a-resumable-sse-stream-is-re-attached-across-a-load-balanced-edge-that-has-already-repl.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2033,
    "python_slice_tokens": 368,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the SSE stream dropped.\" Streams drop constantly and resumption is designed for that. The failure is that **the resumption succeeded while the session identity silently forked**: the client believes it holds one logical session `S` with a monotonic event log, but the edge routed the re-attach to a replica that never issued the events the ...",
    "what_was_observed": "A tool-calling agent held a session against a 3-replica MCP server behind a round-robin edge with 60s idle timeout. Mid-task, after a long-running `tools/call` (a code-execution tool that took 90s), the client's SSE channel was reaped by the edge. The client re-attached with `GET /mcp` carrying `Mcp-Session-Id: 0a3f…` and `Last-Event-ID: 118`. The edge, having no affinity, sent it to replica B, whose in-memory sessio...",
    "condition_of_validity": "The detection rule below is valid only when the client can observe **both** of the following on re-attach: 1. The `Mcp-Session-Id` in the response differs from the one sent in the request, **or** the server echoes the same ID but the first delivered event's `id` is `<= Last-Event-ID` (a duplicate) or `> Last-Event-ID + 1` (a gap). 2. The client has a record ...",
    "decision_boundary": "The boundary is the **provenance check on `Last-Event-ID`**: does the receiving replica know that this cursor was minted by the same logical session it is about to serve? - **Safe (accept resumption):** server maintains a per-session event log keyed by `Mcp-Session-Id` with a shared or replicated counter; `Last-Event-ID` is a member of that session's emitted...",
    "operational_effect": "Without the provenance check, the system exhibits **at-most-once delivery with at-least-once execution** — the worst quadrant. Results are lost (the terminal event is the one most likely to be in flight during the idle reap), while side effects are duplicated (re-issued calls hit replicas with no shared dedup). The agent's reasoning loop cannot detect this b..."
  },
  "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": "5b03d5d76c21b1b6844a9f0620bc7a8823cd491ab93fa654c7cc6ab8cb819f7a",
    "verified_classes": [
      "SessionForkDetected"
    ],
    "verified_functions": [
      "validate_resumption"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SessionForkDetected"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
