# How should an instance reconcile stream resumption against in-flight server-push elicitation when MCP is carried over HTTP-native bidirectional channels without SSE **Date of Record:** 2026 November 28 **Scope:** Applies to MCP clients/servers that have replaced the legacy SSE transport with a single HTTP request/response channel upgraded to a bidirectional framed stream (e.g., HTTP/2 or HTTP/3 with full-duplex body, or a WebSocket-over-HTTP upgrade), where the server may push `elicitation/create` requests to the client mid-stream and the client may resume a broken stream via `Last-Event-ID`-style cursor replay. Does not apply to classic SSE transport (where event IDs are monotonic and replay is idempotent by construction) or to stateless one-shot `tools/call` invocations. ## Core Distinction The failure mode is not "the stream dropped." Drops are routine. The failure mode is a **replay/elicitation ordering hazard**: the server's resumption cursor is defined over *outbound* frames (responses and notifications), but `elicitation/create` is a *server-initiated request* whose lifecycle is owned by the client's response, and whose in-flight state exists only in server memory keyed by a request ID. When the client resumes with a cursor that predates the elicitation push, the server replays the elicitation frame; the client—having already answered it before the drop, or having never seen it—now holds a divergent belief about whether that request ID is outstanding. The invariant that must hold is: **the set of outstanding server→client request IDs after resumption must equal the set the server believes is outstanding, and every elicitation must be resolved exactly once with a client-visible causal predecessor.** Neither SSE semantics nor naive cursor replay gives you this for free. ## What Was Observed A client instance was mid-`tools/call` on a long-running `deploy.rollout` tool. The server pushed an `elicitation/create` asking the user (via the client) to confirm a production cutover. The client rendered the prompt, the human approved, the client emitted the `elicitation/response` frame, and the server advanced its tool state machine to `awaiting_deploy`. Two seconds later the TCP connection was reset by an intermediary (idle-timeout on a proxy that did not understand the duplex body). The client reconnected with `Last-Event-ID: 4417`, the last *notification* frame it had durably processed. The elicitation push had been frame `4419`. The server, on resume, replayed frames `4418..4419` — including the elicitation `create`. The client, whose local elicitation ledger had been keyed by `(session_id, request_id)` and had *not* been checkpointed because it was considered transient UI state, saw an elicitation it had no record of answering and re-prompted the human. The human approved again. The server received a second `elicitation/response` for request ID `elicit-7f3a` while its state machine had already transitioned past `awaiting_deploy`; it treated the duplicate as a protocol violation and tore down the session, killing the in-flight rollout at 60% completion with no compensating abort. A second observed variant: the client crashed *after* sending `elicitation/response` but *before* receiving the server's `elicitation/result` acknowledgement. On resume from cursor `4417`, it replayed `4419` (the create), and — because its ledger was empty — re-answered. Same duplicate. The cursor replay was correct by the server's definition and wrong by the protocol's semantics. ## Condition of Validity Cursor-based resumption is only sound under three conditions, and MCP-over-duplex-HTTP violates the third: 1. Frames are totally ordered and the cursor names a unique resume point — true here. 2. Replayed frames are **idempotent on the receiver** — true for notifications and tool results, *false* for server-initiated requests, because the client's response is a side effect with no dedup key. 3. The receiver's durable state covers everything the replayed frames can reference — **false**: the elicitation ledger lived in volatile memory. The condition of validity for the whole mechanism is therefore: *either* the elicitation ledger is checkpointed into the same durable store as the cursor (so the client can answer "already resolved, here is the cached response, do not re-prompt"), *or* the server never replays a server-initiated request frame across a resume boundary and instead re-issues it with a fresh request ID under a new causal sequence number. The observed system did neither, so the invariant was simply absent. ## Decision Boundary The boundary is whether the resumption cursor is defined over the **frame stream** or over the **session state machine**. These coincide only when every frame is a pure function of prior state. The moment the server injects a request whose resolution depends on the client's *future* action, the frame stream and the state machine diverge, and replay becomes semantically lossy. Concretely, an instance should treat the boundary as crossed when *all* of the following hold: (a) the transport is resumable via cursor, (b) the server may push requests (not just notifications/results), and (c) the client's response to a pushed request is not durably logged before the response is transmitted. If any of (a)–(c) is false, ordinary cursor replay is safe. If all three are true, cursor replay is unsound for the request frames and requires an explicit reconciliation step on resume. The reconciliation rule: on resume, the client must **not** blindly replay. It must send a `session/resume` frame carrying `{cursor, outstanding_request_ids: [...], resolved_request_ids: [...]}` and the server must diff this against its own in-flight request table before emitting any replayed frames. Any request ID in the server's table but not in the client's `resolved` set is re-issued with a **new** ID and a `supersedes` field; any ID in the client's `resolved` set but still in the server's table is acknowledged and cleared without re-push. ## Operational Effect Without the reconciliation handshake, the operational consequences are deterministic: duplicate elicitation responses (session teardown, as observed), or — worse — the *silent* variant where the client's volatile ledger survives but the server's does not, the server re-pushes, the client suppresses the duplicate, and the server waits forever on an acknowledgement that will never arrive because the client believes it already answered. That is a liveness deadlock with no timeout, because neither side considers itself at fault. The guardrail is a two-part invariant an instance must enforce locally: **(1) log-before-send** — the elicitation response is written to the same durable store as the cursor *before* the frame goes on the wire, so replay can be deduped; and **(2) reconcile-before-replay** — no replayed frame is applied until the resume handshake has diffed client and server request tables. The first bounds the duplicate-response hazard; the second bounds the deadlock. Neither is optional when the transport is bidirectional and resumable, because the elicitation is the one MCP primitive whose correctness depends on *both* endpoints agreeing on a request's liveness, and cursor replay only ever encodes one endpoint's view. ```python import hashlib from dataclasses import dataclass, field class ElicitationResumeDivergence(RuntimeError): """Raised when a resumed stream would re-deliver or orphan an elicitation.""" pass @dataclass class ElicitationLedger: # Durable: must be persisted alongside the stream cursor. resolved: dict[str, str] = field(default_factory=dict) # request_id -> response_digest outstanding: set[str] = field(default_factory=set) # pushed, not yet answered def record_send(self, request_id: str, response: str) -> None: # Log-before-send: write durable state BEFORE the frame hits the wire. digest = hashlib.sha256(response.encode()).hexdigest() self.resolved[request_id] = digest self.outstanding.discard(request_id) def reconcile_on_resume(self, server_inflight: set[str]) -> list[str]: """Return request IDs the server must re-issue with fresh IDs. Raises if the server believes a request is live that we already answered (duplicate hazard) AND we cannot prove we answered it, or if we hold an outstanding request the server has forgotten (orphan/deadlock hazard). """ # Server thinks live, we think resolved -> must NOT replay; tell server to clear. cleared = server_inflight & set(self.resolved) # Server thinks live, we have no record -> safe to replay (we never answered). replayable = server_inflight - set(self.resolved) - self.outstanding # We think live, server forgot -> deadlock; cannot proceed. orphaned = self.outstanding - server_inflight if orphaned: raise ElicitationResumeDivergence( f"orphaned elicitations {sorted(orphaned)}: client awaiting " f"responses the server no longer tracks; resume would deadlock" ) # Duplicate-answer hazard: server has it live but we hold a response digest # that was never acknowledged. Re-issue with new ID rather than replay. if cleared and not all(self.resolved[rid] for rid in cleared): raise ElicitationResumeDivergence( f"unprovable resolution for {sorted(cleared)}; refusing replay" ) return sorted(replayable) def resume_stream(ledger: ElicitationLedger, cursor: int, server_inflight: set[str], replay_frames: list[dict]) -> list[dict]: reissue = ledger.reconcile_on_resume(server_inflight) applied: list[dict] = [] for frame in replay_frames: if frame.get("method") == "elicitation/create": rid = frame["params"]["request_id"] if rid in ledger.resolved: # Already answered before the drop: suppress, do not re-prompt. continue if rid not in reissue: raise ElicitationResumeDivergence( f"replay of un-reconciled elicitation {rid} at cursor {cursor}" ) applied.append(frame) return applied ```