{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-resume-an-mcp-sse-session-after-a-streamable-http-upgrade-the-last-event-id-replay-gap-across-transport-migration",
  "title": "When must an instance refuse to resume an MCP SSE session after a streamable-HTTP upgrade: the Last-Event-ID replay gap across transport migration",
  "date_of_record": "2026 November 16",
  "scope": "Applies to MCP servers and clients that expose the same logical session over both the legacy HTTP+SSE transport and the newer streamable-HTTP transport, where a client may reconnect via `Last-Event-ID` after a transport switch. Does not apply to pure stdio sessions or to single-transport deployments where no migration occurs mid-session.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-resume-an-mcp-sse-session-after-a-streamable-http-upgrade-the-last-event-id-replay-gap-across-transport-migration.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-resume-an-mcp-sse-session-after-a-streamable-http-upgrade-the-last-event-id-replay-gap-across-transport-migration.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-resume-an-mcp-sse-session-after-a-streamable-http-upgrade-the-last-event-id-replay-gap-across-transport-migration.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1530,
    "python_slice_tokens": 292,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **event continuity** and **event replayability**. A streamable-HTTP server can keep a monotonically increasing event ID sequence across a transport upgrade and still be unable to replay the events emitted before the upgrade, because the pre-upgrade events were written to a per-connection SSE buffer that is destroyed wh...",
    "what_was_observed": "In a deployment where an MCP server fronted a long-running tool-call session, a client connected over legacy HTTP+SSE, received events with IDs `1000..1042`, then was instructed (via a `Mcp-Session-Id` re-negotiation after a load-balancer rollout) to reconnect using streamable HTTP with `Last-Event-ID: 1042`. The server accepted the connection, returned `200` with `text/event-stream`, and emitted events `1043..`. The...",
    "condition_of_validity": "Resumption via `Last-Event-ID` is valid only when all of the following hold: 1. The event identified by `Last-Event-ID` is physically present in the replay store backing the transport that will serve the resumed stream, not merely numerically less than the current counter. 2. The transport generation that produced the event is the same generation (or a gener...",
    "decision_boundary": "The server must branch on **replay-store membership**, not on counter comparison: - If `Last-Event-ID` is absent: start a fresh stream at the current counter. Valid. - If `Last-Event-ID` is present and the event is in the current replay store: resume from the next event. Valid. - If `Last-Event-ID` is present, is numerically ≤ current counter, but is **not**...",
    "operational_effect": "When the boundary is enforced, transport migration becomes a visible event: clients that were mid-stream receive a `ResumePointUnreplayable` error and are forced to reconcile (re-fetch a session snapshot, re-issue the in-flight tool call with idempotency keys, or surface the failure to the orchestrator). This is the correct trade: a loud, typed failure at mi..."
  },
  "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": "394e60a17e367a0de9b9bc9e4c9cb620fa835423de4b2f4bc65397bdce07ded0",
    "verified_classes": [
      "ResumePointUnreplayable"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ResumePointUnreplayable"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
