{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-fresh-capability-negotiation-rather-than-a-stream-continuation",
  "title": "In what scenarios must an instance treat an MCP `Last-Event-ID` resume as a fresh capability negotiation rather than a stream continuation",
  "date_of_record": "2026 November 23",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport with SSE streaming and `Last-Event-ID`-based resumption, where a session spans multiple tool calls and the server may re-issue or mutate capability grants across reconnects. Does not apply to stdio transport, nor to stateless single-request MCP deployments where no session identifier is issued.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-fresh-capability-negotiation-rather-than-a-stream-continuation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-fresh-capability-negotiation-rather-than-a-stream-continuation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-fresh-capability-negotiation-rather-than-a-stream-continuation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1524,
    "python_slice_tokens": 376,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP HTTP-native transport exposes two superficially similar recovery paths that share a header but diverge in semantics: **event replay** (the transport resends SSE frames the client missed, keyed by `Last-Event-ID`) and **session resumption** (the logical session — its negotiated capabilities, initialized state, and pending request table — is rehydrated...",
    "what_was_observed": "A client agent held an SSE stream to an MCP server. Mid-task, after a tool call that triggered a long-running operation, the TCP connection dropped (NAT rebind, ~90s idle). The client reconnected with `Last-Event-ID: 4471`. The server returned `200 OK`, replayed events `4472..4489`, and the stream resumed. The agent assumed continuity and issued the next tool call — `write_file` — which had been granted during the or...",
    "condition_of_validity": "The invariant holds — a `Last-Event-ID` resume is a stream continuation and *not* a session continuation — under all of the following: 1. The server retains event buffers with a TTL **independent** of session-record TTL (the common implementation, since buffers are cheap and sessions are not). 2. Session identity is not cryptographically bound to the event c...",
    "decision_boundary": "On every reconnect that supplies `Last-Event-ID`, the client MUST branch: - **If** the server's resume response includes an explicit session-epoch marker (a `Mcp-Session-Id` that matches the pre-disconnect value **and** a server-declared epoch/generation counter that is unchanged) → treat as continuation; apply only the replayed delta, but still process ever...",
    "operational_effect": "Agents that skip the epoch check exhibit a characteristic failure signature: intermittent `Method not found` and `Invalid params` errors that cluster after network blips and vanish on manual restart — because restart forces a clean `initialize`. Worse, non-idempotent tool calls (`write_file`, `send_message`, payment-like operations) get silently retried agai..."
  },
  "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": "9240dd272c174b5b66951a8e3c7180630108cfd5c328e40430222b296f4adc68",
    "verified_classes": [
      "StaleSessionResumeError",
      "SessionEpoch",
      "ResumeResponse"
    ],
    "verified_functions": [
      "reconcile_resume",
      "dispatch_after_resume",
      "from_initialize"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "StaleSessionResumeError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
