{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-token-as-invalid-across-a-transport-migration-and-what-breaks-when-it-doe",
  "title": "Under what conditions must an instance treat an MCP `Last-Event-ID` resumption token as invalid across a transport migration, and what breaks when it does not",
  "date_of_record": "2026 November 24",
  "scope": "Applies to MCP clients and servers that migrated (or are mid-migration) from the legacy HTTP+SSE transport to streamable HTTP, where event IDs and session IDs are used for resumability. Does not apply to stdio transport, nor to pure in-memory transports where no `Last-Event-ID` replay semantics exist.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-token-as-invalid-across-a-transport-migration-and-what-breaks-when-it-doe.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-token-as-invalid-across-a-transport-migration-and-what-breaks-when-it-doe.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-token-as-invalid-across-a-transport-migration-and-what-breaks-when-it-doe.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2053,
    "python_slice_tokens": 378,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The legacy MCP HTTP+SSE transport and the streamable HTTP transport both expose a resumability surface built from two identifiers: a `session` identifier (opaque, per-connection) and a monotonically increasing event identifier carried in SSE `id:` lines and echoed back by the client via the `Last-Event-ID` request header on reconnect. The critical, non-obvio...",
    "what_was_observed": "A client instance running a long tool-execution loop (a `tools/call` against a slow filesystem-search tool) held an open streamable-HTTP SSE response. The server emitted events with IDs of the form `sess_7f3a:0001`, `sess_7f3a:0002`, … The client's transport layer, written against the older SSE transport, stored only the numeric suffix (`0001`, `0002`) because the legacy server had used bare integers. When the networ...",
    "condition_of_validity": "A `Last-Event-ID` resumption is valid **if and only if** all three hold: - **(a) Session binding.** The `Mcp-Session-Id` presented with the resumption request is byte-identical to the session that minted the event ID. The server must reject, not clamp, a token whose session prefix does not match. - **(b) Namespace integrity.** The event ID is treated as an o...",
    "decision_boundary": "The boundary that separates safe from unsafe behavior is whether the client's transport layer distinguishes \"reconnect to the same session\" from \"re-initialize the session.\" The legacy SSE transport collapsed these into one operation because there was no session identifier to lose. The streamable-HTTP migration splits them, and the split is where the bug liv...",
    "operational_effect": "The observable effect of getting this wrong is not a crash. It is a *silent liveness gap*: the agent's execution loop is blocked on a response that will never arrive on the stream it is reading, while the actual response sits unread on a stream no one is draining. The agent's timeout fires, it retries, and the retry produces a duplicate side effect because t..."
  },
  "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": "073cf7f0a39cd7c0947abd9e718a08337c1c5116d9797e1b62d8e51e091a78b3",
    "verified_classes": [
      "ResumptionTokenError",
      "EventId",
      "SessionLog",
      "StreamableHttpServer"
    ],
    "verified_functions": [
      "reconnect",
      "encode",
      "decode",
      "__init__",
      "open_session",
      "append",
      "resume"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 8,
    "raised_exceptions": [
      "ResumptionTokenError"
    ],
    "sample_fail_closed_invariants": [
      "no token to resume from",
      "client re-initialized session; discard token and re-issue pending requests"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
