{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-stream-after-a-crash-mid-notifications-tools-list-changed-and-replays-a-stale-session",
  "title": "What happens when an instance resumes an MCP stream after a crash mid-`notifications/tools/list_changed` and replays a stale session",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP servers using the HTTP-native transport (Streamable HTTP / `text/event-stream` with `Mcp-Session-Id` and `Last-Event-ID` resumption) where a client agent's process dies or its TCP connection is severed mid-stream and it attempts to resume with a persisted session ID. Does not cover stdio transport, does not cover clean client-initiated `DELETE`-based session teardown, and does not cover servers that treat every request as stateless.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-stream-after-a-crash-mid-notifications-tools-list-changed-and-replays-a-stale-session.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-stream-after-a-crash-mid-notifications-tools-list-changed-and-replays-a-stale-session.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-stream-after-a-crash-mid-notifications-tools-list-changed-and-replays-a-stale-session.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2030,
    "python_slice_tokens": 376,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The HTTP-native MCP transport exposes two independent continuity mechanisms that are routinely conflated: **session continuity** (the `Mcp-Session-Id` header, which binds server-side state to a client identity) and **event-stream continuity** (the SSE `id:` field plus `Last-Event-ID` on resume, which binds a *position in a notification sequence* to a resumpt...",
    "what_was_observed": "A client agent maintained a long-lived SSE stream to an MCP server exposing a tool set that mutated on deploy (tools added/removed, input schemas revised). The client persisted `{session_id, last_event_id}` to disk after every event to survive process restarts. On crash-and-resume, the client reconnected with `Mcp-Session-Id: <persisted>` and `Last-Event-ID: <persisted>`. The failure trace, over three deploys: 1. **E...",
    "condition_of_validity": "The gap-silently-dropped failure requires all of the following to hold simultaneously: - The server uses a **bounded** replay buffer (time- or count-based). Unbounded servers replay-from-start and convert this failure into a different one (duplicate/out-of-order application), not a silent gap. - The client persists `last_event_id` **at-least-once but not ato...",
    "decision_boundary": "The load-bearing invariant is: **a session ID match does not imply event-stream continuity, and an event-stream resume that cannot honor `Last-Event-ID` must be treated by the client as a full cache invalidation, not as a continuation.** Concretely, the client must branch on the *server's actual resumption behavior*, not on the `200` status: - If the server'...",
    "operational_effect": "Without the reconciliation step, the observable effect is a **silent, non-converging tool-call loop**: the agent retries a call whose schema it holds stale, the server rejects against the current schema, and the agent's error-handling logic classifies the rejection as a transient fault rather than a cache fault. Because the rejection is deterministic, retrie..."
  },
  "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": "6cc5b3fef0c47fd259c55c80c7175545500563f73b087b89344b9ceeb5ba6bec",
    "verified_classes": [
      "StreamResumeGapError",
      "PersistedStreamState"
    ],
    "verified_functions": [
      "reconcile_resume",
      "guarded_tools_call"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "StreamResumeGapError"
    ],
    "sample_fail_closed_invariants": [
      "resume reported a gap but no refreshed tool schema was produced; refusing to issue tools/call against a possibly stale s"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
