{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-stream-resumption-with-session-resumption-when-an-mcp-server-s-sse-event-id-and-session-id-diverge-across-a-reconnect",
  "title": "Where must an instance reconcile stream resumption with session resumption when an MCP server's SSE event ID and session ID diverge across a reconnect",
  "date_of_record": "2026 November 24",
  "scope": "Applies to MCP clients and servers using the HTTP-native transport (Streamable HTTP with SSE streaming and `Last-Event-ID` resumption) where a session is established via `Mcp-Session-Id` and a stream is resumed via `Last-Event-ID`. Does not apply to stdio transport, nor to stateless HTTP servers that do not issue a session header.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-stream-resumption-with-session-resumption-when-an-mcp-server-s-sse-event-id-and-session-id-diverge-across-a-reconnect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-stream-resumption-with-session-resumption-when-an-mcp-server-s-sse-event-id-and-session-id-diverge-across-a-reconnect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-stream-resumption-with-session-resumption-when-an-mcp-server-s-sse-event-id-and-session-id-diverge-across-a-reconnect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1956,
    "python_slice_tokens": 360,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP HTTP transport carries two *independent* resumption primitives that are trivially confused because both look like \"resume where I left off\": - **Stream resumption** — governed by SSE `id:` fields and the `Last-Event-ID` request header. It answers: *which bytes of this one response body have I already consumed?* It is scoped to a single HTTP response ...",
    "what_was_observed": "An agent client maintained a long-lived SSE stream over Streamable HTTP, receiving server→client messages (notifications, sampling requests, progress). Each event carried a monotonically increasing `id:`. The client persisted the last seen event ID and the `Mcp-Session-Id` to durable storage so it could survive a process restart — a cold-start resume. The server reaped the session after an idle timeout (session TTL i...",
    "condition_of_validity": "Stream resumption via `Last-Event-ID` is only sound under the conjunction: 1. The session identified by `Mcp-Session-Id` is **still live** at replay time (server has not reaped it), **and** 2. The event-ID space is **scoped to the session**, i.e. event IDs from a dead session are never replayed into a live one, **and** 3. The server validates the pair `(Mcp-...",
    "decision_boundary": "On every reconnect, the agent must classify the `(session, stream)` pair into exactly one of four states and act accordingly: - **Live session + valid event ID (both confirmed):** resume the stream with `Last-Event-ID`; replay is authoritative; dedup by event ID is safe. - **Live session + no/stale event ID:** resume the stream *without* `Last-Event-ID` (fre...",
    "operational_effect": "The practical consequence is that cold-start resume for MCP HTTP agents must be a **two-phase handshake, not a single GET**: first confirm session liveness (via the session header and a lightweight round-trip that exercises the session layer, not the stream layer), and only then attach the stream cursor. Persisting `Last-Event-ID` without persisting the *epo..."
  },
  "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": "c76047bd08b514fb37c115d2b3c567bef24a6c643a0c75e788de65791888ca0e",
    "verified_classes": [
      "ResumptionState",
      "ResumptionDivergence",
      "ResumeToken"
    ],
    "verified_functions": [
      "classify_reconnect",
      "build_resume_request"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ResumptionDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
