{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-new-session-rather-than-a-continuation-and-why-silent-acceptance-corrupt",
  "title": "Under what conditions must an instance treat an MCP `Last-Event-ID` resume as a *new* session rather than a continuation, and why silent acceptance corrupts tool state",
  "date_of_record": "2026 November 24",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport with `StreamableHTTPSession` and server-initiated SSE upgrade negotiation, where the client presents a `Last-Event-ID` header on `GET /mcp` after a transport drop. Does not cover stdio transport, WebSocket fallback, or clients that never issue a resumable GET.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-new-session-rather-than-a-continuation-and-why-silent-acceptance-corrupt.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-new-session-rather-than-a-continuation-and-why-silent-acceptance-corrupt.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-new-session-rather-than-a-continuation-and-why-silent-acceptance-corrupt.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2033,
    "python_slice_tokens": 255,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP HTTP-native transport defines two superficially similar recovery paths that share a wire format but diverge in semantics: 1. **Resume** — the client reconnects to the *same* logical session with a `Last-Event-ID` that the server can map to a retained event buffer. The server replays events from `Last-Event-ID+1` onward. Session identity, tool-call co...",
    "what_was_observed": "A two-tool MCP server (a `filesystem.read` and a `shell.exec` pair) fronted by a load balancer with three replicas. Sessions were sticky by cookie but the SSE event buffer was **per-replica and in-memory**. The failure trace: 1. Client opens session `S1` on replica A. Issues `tools/call` for `shell.exec` running a long job. Server emits `event: progress, id: 41`. Client records `Last-Event-ID: 41`. 2. Replica A is dr...",
    "condition_of_validity": "A `Last-Event-ID` resume is **valid** — i.e., the server may return `200` with a replay and the client may treat the session as continuous — if and only if all three hold: - **Contiguity:** the server retains a contiguous event range `[Last-Event-ID+1, N]` with no gaps. A buffer that retains a *suffix* but not a *prefix* of the requested range is not a valid...",
    "decision_boundary": "The precise branch the server must implement, evaluated in order, on `GET /mcp` with `Mcp-Session-Id` and optional `Last-Event-ID`: - No `Mcp-Session-Id`, or session unknown → `404`. Client initializes. - Session known, no `Last-Event-ID` → open live stream from tail. This is a *subscribe*, not a resume; no replay promised. - Session known, `Last-Event-ID` p...",
    "operational_effect": "When the server honors the boundary, the failure mode is loud and recoverable: the client gets `410`, reinitializes, and the agent loop is told \"your prior tool call is abandoned — check idempotency before retry.\" The agent pays a cold-start cost (re-negotiate capabilities, re-fetch tool schemas) but does not double-execute side effects. When the server viol..."
  },
  "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": "af73f5008ba03acde79189908d2175c5215a0ff199dddfdf47590d5499438529",
    "verified_classes": [
      "ResumeIncoherenceError",
      "SessionState"
    ],
    "verified_functions": [
      "can_faithfully_resume",
      "handle_resumable_get"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ResumeIncoherenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
