{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-resumption-as-unsafe-after-an-sse-to-streamable-upgrade-and-how-does-the-last-eve",
  "title": "In what scenarios must an instance treat MCP Streamable-HTTP session resumption as unsafe after an SSE-to-streamable upgrade, and how does the `Last-Event-ID` cursor silently diverge from the server's replay window?",
  "date_of_record": "2026 December 3",
  "scope": "Applies to MCP clients and servers speaking the Streamable HTTP transport where a session begins on the legacy `text/event-stream` GET channel and is later upgraded to a POST/streamable session, and where resumption is attempted via `Last-Event-ID` after a transport interruption. Does not cover pure stdio transports, stateless one-shot request/response, or WebSocket-based custom transports.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-resumption-as-unsafe-after-an-sse-to-streamable-upgrade-and-how-does-the-last-eve.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-resumption-as-unsafe-after-an-sse-to-streamable-upgrade-and-how-does-the-last-eve.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-resumption-as-unsafe-after-an-sse-to-streamable-upgrade-and-how-does-the-last-eve.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1705,
    "python_slice_tokens": 282,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The critical distinction is between **event identity** and **replay eligibility**. The `Last-Event-ID` header carries an *event identifier* the client last saw; it does **not** carry a promise that the server can still *replay* from that identifier. In a streamable session these two are usually coupled because the server retains a bounded ring buffer keyed b...",
    "what_was_observed": "A representative trace from a client that had been running a long-lived tool-call loop: 1. Session opens on legacy SSE: `GET /mcp` → `200`, stream begins. Server assigns event IDs `e-1001`, `e-1002`, … in a per-connection counter. 2. Client processes through `e-1042`. It records `lastEventId = \"e-1042\"` and the corresponding tool-call state (`call_id=42`, `status=in_flight`). 3. Transport drops (idle LB timeout at 60...",
    "condition_of_validity": "The naive resumption assumption — *\"a 200 on reconnect with `Last-Event-ID` means no events were lost\"* — is valid **only** under all of the following: - **(V1) Namespace stability:** the server's event-ID scheme is monotonic and unbroken across the upgrade boundary, so `Last-Event-ID` is comparable to the first replayed ID. - **(V2) Replay-window containmen...",
    "decision_boundary": "The boundary is a single predicate evaluated at reconnect time, *before* any event is appended to agent state: If `resume_safe` is false, the client must not resume — it must reconcile. The decision is binary and must be made on the first frame of the resumed stream, not deferred. Deferring is the trap: once the client has appended even one post-upgrade even...",
    "operational_effect": "Without the guard, the observed failure modes are: - **Orphaned in-flight calls:** agent blocks or duplicates side effects (double-charges, double-writes) because the result frame was in the evaporated window. - **Silent state divergence:** client log and server truth differ by the gap interval, and every subsequent reasoning step is built on a false premise..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "1d578293ed4c25c488e884046e5dd053fc071f2e34be3f9bf75bf6f9b1c5df88",
    "verified_classes": [
      "ResumeContinuityError",
      "StreamCursor"
    ],
    "verified_functions": [
      "parse_event_id",
      "assert_resume_safe",
      "resume_session"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumeContinuityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "re"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
