{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-fresh-session-rather-than-a-replay",
  "title": "Under what conditions must an instance treat an MCP `Last-Event-ID` resume as a fresh session rather than a replay",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP servers and clients that migrated from the legacy HTTP+SSE transport (dual-endpoint: `GET /sse` event stream + `POST /messages`) to the streamable-HTTP transport (single endpoint, optional `Mcp-Session-Id` header, optional SSE-framed responses, resumability via `Last-Event-ID`). Does not cover stdio transport, nor WebSocket-based custom transports, nor pure request/response MCP servers that never emit SSE frames.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-fresh-session-rather-than-a-replay.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-fresh-session-rather-than-a-replay.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-fresh-session-rather-than-a-replay.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2415,
    "python_slice_tokens": 303,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The legacy SSE transport had a *structural* resumption guarantee: the `GET /sse` connection was long-lived and the server held the live stream object in memory keyed by connection. If the connection dropped, the client reconnected and the server either replayed from its buffer or the stream was simply gone — and the client knew, because the `endpoint` event ...",
    "what_was_observed": "A tool-calling agent ran a three-step plan: `search` → `fetch` → `summarize`. The MCP server was a streamable-HTTP implementation behind a load balancer with three replicas and a 90-second session idle TTL. The agent's client used SSE-framed `POST` responses and tracked `Last-Event-ID` per the reference SDK. The failure trace: 1. Step 1 (`search`) completed. Server emitted event `id: 41` (the `tool_result`) then `id:...",
    "condition_of_validity": "The invariant that must hold for safe resumption is: > A `Last-Event-ID` may be honored **only if** the server can prove the referenced event belongs to a session that is still live *and* the buffer covering `(lastEventId, now]` is intact. If either proof fails, the server MUST NOT mint a new session under the same request; it MUST return a resumption failur...",
    "decision_boundary": "The decision the server must make on every request carrying `Last-Event-ID`: The boundary that implementations get wrong is row 4. The tempting shortcut — \"session unknown, so treat as new, mint `S'`\" — is exactly what broke the agent above. A reaped session is *not* a new client. The server has positive evidence the client is mid-session (it sent a session ...",
    "operational_effect": "The guardrail is a two-sided contract, and both sides must enforce it or neither works: **Server side:** Never mint a session on a request that carried a `Mcp-Session-Id`. Distinguish \"no session id\" (fresh) from \"session id that no longer resolves\" (failed resume). Persist a tombstone with the last emitted event id for a grace window (≥ the max observed int..."
  },
  "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": "46f13ac214bb31150eb9b18a31b4e017679c2035b3e9eab065fad3182ad07539",
    "verified_classes": [
      "SessionResumptionError"
    ],
    "verified_functions": [
      "handle_streamable_http_request"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SessionResumptionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
