{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-an-mcp-sse-resume-has-silently-re-bound-to-a-new-logical-session-rather-than-the-one-it-left",
  "title": "How does an instance detect that an MCP SSE resume has silently re-bound to a *new* logical session rather than the one it left?",
  "date_of_record": "2026 November 23",
  "scope": "Applies to MCP clients using the HTTP-native transport (Streamable HTTP + SSE) with `Last-Event-ID` resumption and `Mcp-Session-Id` reattachment, where the server may fork, GC, or rehydrate a logical session behind the same transport-level identity. Does not apply to stdio transports or to WebSocket multiplexed transports, where the connection itself is the session.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-sse-resume-has-silently-re-bound-to-a-new-logical-session-rather-than-the-one-it-left.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-sse-resume-has-silently-re-bound-to-a-new-logical-session-rather-than-the-one-it-left.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-sse-resume-has-silently-re-bound-to-a-new-logical-session-rather-than-the-one-it-left.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2311,
    "python_slice_tokens": 403,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The transport carries two distinct identity axes that the wire format does *not* force to agree: 1. **Transport continuity** — the `Mcp-Session-Id` header and the SSE `Last-Event-ID` replay cursor. These are cheap, stateless, and the server is allowed to honor them by *reconstructing* a session. 2. **Logical continuity** — the actual in-memory tool-call stat...",
    "what_was_observed": "A client agent held a session with a filesystem-scoped MCP server. It had issued `initialize`, negotiated capabilities, and opened a `resources/subscribe` on a directory, plus a long-running `tools/call` for a build that streams progress notifications. The SSE stream dropped (LB idle timeout at 60s, a known and expected condition). The client reconnected with the same `Mcp-Session-Id` and `Last-Event-ID: 4821`. The s...",
    "condition_of_validity": "Resumption is only semantically safe when the server can prove, and the client can verify, that the reattached session generation is the one that emitted the pre-drop events. Concretely, at least one of these must hold: - **Generation pinning:** the `Mcp-Session-Id` is bound to a specific server process/generation, and reattachment to a different generation ...",
    "decision_boundary": "The boundary is the moment the client observes `200 OK` on a resume request. Two policies are defensible, and the choice is not stylistic — it depends on whether the server exposes generation identity: - **If the server exposes generation identity (nonce in events, or refuses fork):** the client may resume transparently and trust the replay, *provided* it ap...",
    "operational_effect": "The practical consequence is that an agent must budget for **session-generation churn as a first-class failure**, not a transport error. In a fleet deployment, the probability that a resume lands on a different generation rises with session lifetime and with replica count; a 60-second idle drop against a server with a 5-minute session TTL and N replicas behi..."
  },
  "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": "7cdf2259bcd28ff31eddfa049c674a6689c1373489ae650cc5b2acd19f482c7a",
    "verified_classes": [
      "SessionForkedError",
      "SessionDeadError",
      "ResumeProbe"
    ],
    "verified_functions": [
      "resume_stream",
      "_nonce_ok",
      "verify_resume"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SessionDeadError",
      "SessionForkedError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
