{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-an-mcp-sse-upgrade-as-a-fresh-session-rather-than-a-resumption",
  "title": "When must an instance treat an MCP SSE upgrade as a fresh session rather than a resumption",
  "date_of_record": "2026 November 13",
  "scope": "Applies to MCP servers exposing the HTTP-native transport where a client may issue an SSE upgrade request carrying a `Mcp-Session-Id` header and a `Last-Event-ID` for stream resumption. Does not apply to stdio transport, nor to stateless HTTP servers that do not mint session identifiers.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-sse-upgrade-as-a-fresh-session-rather-than-a-resumption.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-sse-upgrade-as-a-fresh-session-rather-than-a-resumption.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-sse-upgrade-as-a-fresh-session-rather-than-a-resumption.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1204,
    "python_slice_tokens": 245,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP HTTP-native transport conflates two orthogonal concerns into a single upgrade request: *transport establishment* (the SSE stream that will carry server-to-client messages) and *session continuity* (resuming a previously established logical session whose event log may have gaps). A client can present a valid `Mcp-Session-Id` while presenting a `Last-E...",
    "what_was_observed": "A client reconnected after a 40-second network partition. It sent `Mcp-Session-Id: 7f3a...` and `Last-Event-ID: 1182`. The server had a 30-second event retention window and had evicted events 1100–1182 during the partition. The server accepted the session token, opened an SSE stream, and silently delivered no replay for events 1100–1182. The client, believing the stream was continuous, proceeded to issue a tool call ...",
    "condition_of_validity": "Resumption is only valid when **all** of the following hold simultaneously: 1. The `Mcp-Session-Id` maps to a session that has not been terminated (not merely present in a lookup table). 2. The requested `Last-Event-ID` is *strictly greater than or equal to* the oldest event still retained for that session, and *less than or equal to* the highest event ever ...",
    "decision_boundary": "The decision hinges on whether the server can *prove* continuity to the client. Three cases: - **Token valid, event retained, no state transition:** resume. Replay from `Last-Event-ID` exclusive. - **Token valid, event evicted:** do not resume. Either reject (`409`) or upgrade fresh with an explicit reset signal. Never upgrade silently. - **Token invalid or ...",
    "operational_effect": "Clients that treat every successful upgrade as a continuous stream will accumulate silent state divergence after any partition exceeding the event retention window. The divergence is not observable at the transport layer—the SSE stream is healthy—and only surfaces when a downstream call depends on an event the client never saw. Operationally, servers should ..."
  },
  "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": "56ec4d1e3b367b7b3d677215a8d99d4b43321130c9de96f40ebca67ad7912c71",
    "verified_classes": [
      "ResumptionInvariantError",
      "SessionRegistry"
    ],
    "verified_functions": [
      "__init__",
      "register",
      "terminate",
      "advance",
      "decide_upgrade"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ResumptionInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
