{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-stream-and-the-server-s-push-queue-has-already-been-drained-by-a-sibling-reconnect",
  "title": "What happens when an instance resumes an MCP stream and the server's push queue has already been drained by a sibling reconnect",
  "date_of_record": "2026 November 20",
  "scope": "Applies to MCP clients using the HTTP-native streaming transport (SSE-over-POST with `Last-Event-ID` resumption) where a server maintains a per-session event buffer and replay cursor. Does not apply to stdio transports, stateless one-shot request/response MCP servers, or transports that do not implement event-ID-based resumption.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-stream-and-the-server-s-push-queue-has-already-been-drained-by-a-sibling-reconnect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-stream-and-the-server-s-push-queue-has-already-been-drained-by-a-sibling-reconnect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-stream-and-the-server-s-push-queue-has-already-been-drained-by-a-sibling-reconnect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2068,
    "python_slice_tokens": 486,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the stream dropped.\" Streams drop constantly and resumption is designed for exactly that. The failure is a **cursor-ownership split**: two client instances (or two reconnects from the same instance after a non-idempotent retry) attach to the same server-side session, and the server's replay buffer is a single-consumer queue indexed by a m...",
    "what_was_observed": "A long-running agent session (call it `A`) drives a multi-tool workflow against a stateful MCP server. The server pushes asynchronous notifications: `notifications/tools/list_changed`, `notifications/resources/updated`, and progress notifications for long-running tool calls. Each push carries an `id:` field; the server keeps a bounded replay ring (say 512 events) and a `drain_watermark` per `Mcp-Session-Id`. Sequence...",
    "condition_of_validity": "The gap-skip is only possible when **all** of the following hold. If any fails, the server either replays correctly or the client detects the gap: - The server's replay buffer is indexed by a **single monotonic drain watermark per session**, not per-connection. (Per-connection cursors eliminate the failure but cost memory proportional to connection count.) -...",
    "decision_boundary": "The architectural choice is: **who owns the cursor, and what does a behind-watermark resume mean?** - **Option A — Server-authoritative watermark, silent skip (current default).** Cheap, bounded memory, but a behind-watermark resume is indistinguishable from a caught-up resume. Unsafe for agents whose plan depends on push content. - **Option B — Server-autho...",
    "operational_effect": "Without the guardrail, the failure manifests as **silent plan divergence with duplicate side effects**. The instance does not crash; it produces a plausible but wrong continuation. The two dominant downstream effects: 1. **Non-idempotent tool re-execution.** Lost progress notifications cause the agent to conclude a tool call stalled and re-issue it. If the t..."
  },
  "matched_failure_symptoms": [
    "SPLIT_BRAIN_OR_ZOMBIE_WORKER"
  ],
  "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": "d9fc580f06923ff9057f907e91707d3b6b9dca9e42215361942cf54140ce40f6",
    "verified_classes": [
      "StreamResumeGapError"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "StreamResumeGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
