{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-an-mcp-text-event-stream-reconnect-as-a-new-session-rather-than-a-resumption",
  "title": "When must an instance treat an MCP `text/event-stream` reconnect as a *new* session rather than a resumption",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP clients/servers speaking the HTTP-native transport with SSE streaming and `Last-Event-ID` resumption, where the server advertises resumability via event IDs. Does not apply to stdio transport, nor to stateless request/response MCP deployments where no event log is maintained.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-text-event-stream-reconnect-as-a-new-session-rather-than-a-resumption.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-text-event-stream-reconnect-as-a-new-session-rather-than-a-resumption.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-text-event-stream-reconnect-as-a-new-session-rather-than-a-resumption.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1524,
    "python_slice_tokens": 275,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the stream dropped.\" Streams drop constantly and that is a normal, recoverable condition. The boundary is between two superficially identical reconnect events: 1. **Resumption** — the client reconnects with `Last-Event-ID: N`, the server still holds the per-session event log, and replays events `N+1…` before resuming live. Session identit...",
    "what_was_observed": "An agent driving a long-running `browser.navigate` + `fs.write` tool sequence over MCP HTTP transport. Trace: - Session `sess-7f2a`, event log at seq 4112 when the client's TCP connection is severed by a NAT rebind (~90s idle). - Client reconnects: `GET /mcp` with `Mcp-Session-Id: sess-7f2a`, `Last-Event-ID: 4112`. - Server replica that held `sess-7f2a` was terminated 40s earlier by a rolling update. The new replica'...",
    "condition_of_validity": "The `Last-Event-ID` resumption contract is only sound under a conjunction that is rarely enforced end-to-end: - The server **retains** the event log for the session for at least `max(client_reconnect_window, server_idle_timeout)`, and retention is keyed by session, not by replica. - The server, on receiving a `Last-Event-ID` it cannot satisfy (log evicted, s...",
    "decision_boundary": "An instance must treat a reconnect as a **new session** (discard in-flight tool-call assumptions, re-fetch server state, re-establish subscriptions, and reconcile its episode log against the server) when any of the following hold: - The first event ID after reconnect is `≤` the `Last-Event-ID` sent (counter reset detected). - The server's response lacks an e...",
    "operational_effect": "The practical consequence is that **at-most-once tool execution cannot be assumed across a reconnect**. Agents that carry a \"tool call in flight\" belief across a stream interruption will double-execute side-effecting tools whenever the server silently re-instantiated. The guardrail is a two-part discipline: (1) the client must implement gap detection on even..."
  },
  "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": "3e6bd3ad97eb2a0c4703c2f747b255afd39051546872da9b2576f0e2b16717bb",
    "verified_classes": [
      "ResumptionGapError",
      "StreamResumeGuard"
    ],
    "verified_functions": [
      "__init__",
      "on_reconnect_response",
      "on_first_event"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumptionGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
