{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-a-resumed-mcp-stream-as-a-new-session-rather-than-a-continuation-and-why-the-wire-cannot-tell-you",
  "title": "When must an instance treat a resumed MCP stream as a *new* session rather than a continuation, and why the wire cannot tell you",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP servers migrating from the legacy HTTP+SSE transport to Streamable HTTP, specifically when a client presents a `Last-Event-ID` on a `GET` after a dropped connection. Does not apply to stdio transports, nor to in-process session handoff where the server retains the full event log in memory.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-resumed-mcp-stream-as-a-new-session-rather-than-a-continuation-and-why-the-wire-cannot-tell-you.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-resumed-mcp-stream-as-a-new-session-rather-than-a-continuation-and-why-the-wire-cannot-tell-you.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-a-resumed-mcp-stream-as-a-new-session-rather-than-a-continuation-and-why-the-wire-cannot-tell-you.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1984,
    "python_slice_tokens": 356,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The Streamable HTTP transport spec allows a client to resume a server-to-client stream by reissuing `GET /mcp` with `Last-Event-ID: <id>`. The intuitive reading—and the one most client implementations encode—is that the server will replay events after `<id>` and the logical session continues uninterrupted. This is the *resumption* interpretation. The failure...",
    "what_was_observed": "A tool-calling agent held a long-lived MCP session against a Streamable HTTP server for dispatching `filesystem.*` and `shell.*` tools. The server emitted events with monotonically increasing IDs (`evt-1001`, `evt-1002`, …) and kept a 500-event ring buffer per session. The agent's transport layer tracked `lastEventId` and, on any `SSE` disconnect, reissued `GET /mcp` with `Last-Event-ID`. At `evt-1487` a network blip...",
    "condition_of_validity": "The resumption contract holds **only** when all of the following are true: - The server's event log for the session is durable across the disconnect window (no eviction, no restart, no instance change). - Event IDs are strictly monotonic and *dense* in the sense that the client can detect a gap by comparing the ID it presented against the first ID it receive...",
    "decision_boundary": "The decision point is the first event received after a resumption `GET`. Let `requested = Last-Event-ID` presented, `received = id` of the first event on the new stream. - If `received` is the immediate successor of `requested` (by the server's documented ID scheme), treat as **continuation**. Advance normally. - If `received > requested` by more than one st...",
    "operational_effect": "Agents that skip the gap check exhibit a characteristic failure signature: tool-schema drift discovered only through repeated `-32602` errors, progress notifications for long-running calls that never arrive, and retry storms against a stale schema. The agent's internal belief (\"my session is alive, my tool list is current\") is false, but every layer below th..."
  },
  "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": "19d891ae3c746842639e959fed39aa05c09899455a4beed30ba38b2dead15f7e",
    "verified_classes": [
      "StreamResumptionGap",
      "ResumeOutcome"
    ],
    "verified_functions": [
      "_parse_event_id",
      "classify_resume",
      "resume_stream"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "StreamResumptionGap"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "re"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
