{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-an-mcp-session-was-silently-re-homed-during-sse-to-streamable-http-migration-without-losing-resumption-continuity",
  "title": "How does an instance detect that an MCP session was silently re-homed during SSE-to-streamable-HTTP migration without losing resumption continuity",
  "date_of_record": "2026 November 22",
  "scope": "Applies to MCP clients and servers migrating from HTTP+SSE transport to streamable HTTP (the `Mcp-Session-Id` header model with `Last-Event-ID` resumption), specifically when a long-lived agent session survives a transport upgrade or a load-balancer re-homing. Does not apply to stdio transport, to WebSocket transports, or to sessions that are explicitly terminated and re-negotiated by design.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-session-was-silently-re-homed-during-sse-to-streamable-http-migration-without-losing-resumption-continuity.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-session-was-silently-re-homed-during-sse-to-streamable-http-migration-without-losing-resumption-continuity.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-session-was-silently-re-homed-during-sse-to-streamable-http-migration-without-losing-resumption-continuity.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1922,
    "python_slice_tokens": 372,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **session identity** and **stream identity**. In the legacy SSE transport, a session was implicitly bound to a single long-lived `GET /sse` connection: the server held the stream open, pushed `endpoint` events, and the client's `POST /messages` calls were correlated by a server-side map keyed on the connection. When th...",
    "what_was_observed": "A tool-using agent held an MCP session against a server that was rolled from SSE to streamable HTTP behind a round-robin load balancer. The agent had issued `tools/call` for a long-running operation and was awaiting the result on the event stream. The trace: - `initialize` returned `Mcp-Session-Id: s-7f3a`. Client stored it. - The SSE `GET` streamed events `id: 100` … `id: 142`. The agent's in-flight `tools/call` (JS...",
    "condition_of_validity": "The guardrail is only sound under these conditions, and each must be asserted, not assumed: 1. **Monotonic event IDs per session.** The server MUST guarantee that `id` values on a given `Mcp-Session-Id` are monotonically increasing and never reused, including across replica handoff. If the server cannot guarantee this, the client cannot use ID regression as ...",
    "decision_boundary": "On every resumption `GET` that returns `200` with `text/event-stream`, the client evaluates a single predicate before treating the stream as continuous: - If the first event `id` is **greater than** the last-seen `Last-Event-ID` → genuine resumption (possibly with a gap; the gap is bounded by the server's declared horizon — if `first_id - last_seen > horizon...",
    "operational_effect": "With the predicate enforced, re-homing degrades to a clean, observable session loss: the agent re-`initialize`s, re-reads its own checkpointed task state, and re-issues only calls whose idempotency keys are absent from the new session's ledger. The cost is a wasted round-trip and a re-init; the benefit is that non-idempotent side effects fire at most once. W..."
  },
  "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": "1366e36eb83092131ce2c815e0a2a744f418cbafc086603782dc1346bf3c2f6e",
    "verified_classes": [
      "SessionRehomedError",
      "ReplayHorizonExceededError",
      "ResumptionState"
    ],
    "verified_functions": [
      "verify_resumption",
      "handle_resumption"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ReplayHorizonExceededError",
      "SessionRehomedError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
