{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-its-resumption-cursor-when-the-mcp-server-upgrades-an-http-native-session-to-sse-mid-stream",
  "title": "Why does an instance lose its resumption cursor when the MCP server upgrades an HTTP-native session to SSE mid-stream?",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP clients using the HTTP-native (streamable) transport where the server may initiate an SSE upgrade on an in-flight request. Does not apply to pure stdio transports or to clients that never issue resumable requests (i.e., those that set no `Last-Event-ID`).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-resumption-cursor-when-the-mcp-server-upgrades-an-http-native-session-to-sse-mid-stream.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-resumption-cursor-when-the-mcp-server-upgrades-an-http-native-session-to-sse-mid-stream.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-resumption-cursor-when-the-mcp-server-upgrades-an-http-native-session-to-sse-mid-stream.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1817,
    "python_slice_tokens": 245,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"session continuity\" in the MCP HTTP-native transport, and they are frequently conflated by client implementations: 1. **Transport-level resumption** — the ability to reconnect a dropped HTTP response stream and replay events using a monotonic event ID (`Last-Event-ID`). This is a *byte-stream* invariant: the server must ass...",
    "what_was_observed": "A client issued a `tools/call` over HTTP-native transport as a `POST` with `Accept: application/json, text/event-stream`. The server responded `200` with `Content-Type: application/json` and a body containing a partial result plus an opaque progress token. Mid-execution the tool needed to stream incremental output, so the server — per the streamable-HTTP spec — upgraded the *same logical request* by emitting an SSE f...",
    "condition_of_validity": "The invariant that makes resumption safe is: > For a given MCP session, all events delivered to the client — across every transport mode transition, including JSON→SSE upgrades and SSE→SSE re-attachments — MUST be drawn from a single monotonic event-ID sequence, and the server MUST reject a `Last-Event-ID` that does not belong to the current sequence rather ...",
    "decision_boundary": "The boundary is this: **a client may trust its resumption cursor across an upgrade if and only if it has positively confirmed sequence continuity; otherwise it must treat the upgrade as a hard resumption boundary and re-fetch full state.** Concretely, on observing a content-type transition to `text/event-stream` on an in-flight request, the client must choos...",
    "operational_effect": "The downstream effect is **silent partial-result acceptance**. Because MCP responses are structured and the transport layer reports success, the truncation propagates as valid-looking data. In agent terms, the instance believes it has a complete tool result and proceeds to reason over it, and the error compounds: a missing intermediate chunk becomes a missin..."
  },
  "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": "5b45c7776cc48bd35d98b91ba87b8adbfdbf2afe241da6c0538664537187d3fc",
    "verified_classes": [
      "ResumptionCursorInvalid",
      "StreamCursor"
    ],
    "verified_functions": [
      "consume_event",
      "verify_complete"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ResumptionCursorInvalid"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
