# What happens when an instance resumes an SSE stream after a server-initiated elicitation has already been consumed downstream **Date of Record:** 2026 November 25 **Scope:** Applies to MCP servers and clients using the HTTP-native streaming transport (Streamable HTTP) with `Last-Event-ID` resumption on the SSE channel, where the server may emit `elicitation/create` requests mid-stream. Does not cover stdio transport, WebSocket transports, or servers that never initiate requests to the client. ## Core Distinction The failure is not "the stream dropped" and it is not "the elicitation was lost." Both of those are recoverable. The failure is a **replay/consumption divergence**: the SSE event log is a durable, replayable sequence indexed by `id`, but the *effect* of a server-initiated elicitation request is a one-shot side effect — a human or orchestrator answered a prompt, a decision was committed, a tool was gated on that answer. When the client reconnects with `Last-Event-ID`, the server replays events from the last acknowledged ID. If the elicitation event sits *at or after* that boundary, the client re-delivers the elicitation to a consumer that already acted on it (duplicate side effect), or — worse — the server has already *resolved* the elicitation internally and the replay event references a request ID that is now dead (orphaned reference). The distinction that matters: **SSE resumption guarantees at-least-once delivery of events; elicitation requires exactly-once semantics on the consumer side, and nothing in the transport negotiates that.** ## What Was Observed A client agent (instance A) was mid-task against an MCP server exposing a `filesystem` toolset over Streamable HTTP. The server emitted, in order: ``` id: 41 event: message {"jsonrpc":"2.0","method":"tools/call","params":{...},"id":"r-88"} id: 42 event: message {"jsonrpc":"2.0","method":"elicitation/create","params":{"message":"Confirm overwrite of /data/out.csv?","requestedSchema":{...}},"id":"e-07"} id: 43 event: message {"jsonrpc":"2.0","method":"notifications/progress","params":{"progressToken":"p-1","progress":0.4}} ``` Instance A received events 41–43, dispatched `e-07` to its human-in-the-loop gate, got an affirmative answer, and POSTed the elicitation result back on the client-to-server channel. The server accepted it, gated the `tools/call` on `r-88`, executed the overwrite, and streamed the result as events 44–47. Instance A then **crashed on an unrelated OOM** before it could persist its `Last-Event-ID` cursor past 43. Its durable cursor remained at 40. On restart, instance A reconnected with `Last-Event-ID: 40`. The server — correctly implementing the spec — replayed from 41. Instance A re-received `e-07` and, because its elicitation gate keys on `requestId` and it had *not* persisted the "already answered e-07" fact (that lived only in the crashed process's memory), it **re-prompted the human**. The human, seeing an identical confirmation for `/data/out.csv` that they had *already approved*, approved again. The server received a second elicitation result for `e-07`, which it had already marked resolved, and — depending on implementation — either (a) rejected it as a duplicate and the client hung waiting for a resolution that would never re-arrive, or (b) accepted it and **executed the overwrite a second time**, because the elicitation result path was not idempotent against the request ID. The second observed variant is the orphaned reference: a server that garbage-collects resolved elicitation state after a TTL replayed `e-07` after the TTL elapsed. The client answered, the server had no record of `e-07`, returned JSON-RPC error `-32602` (invalid params, unknown request id), and the client's task state machine — which treats an elicitation error as "user declined" — **silently took the decline branch** and aborted a task the human had actually approved. No error surfaced to the operator; the task just stopped. ## Condition of Validity The invariant that must hold for safe resumption is: > **For every server-initiated request ID `e`, the client's durable resumption state must record the terminal outcome of `e` (answered / declined / errored) *atomically with* the advancement of the SSE cursor past the event that carried `e`. The server must retain the resolution record for `e` for at least as long as any client may legally resume with a `Last-Event-ID` preceding `e`'s event.** Both halves are required. The client half fails when the cursor and the elicitation-outcome ledger are persisted in separate stores with no shared transaction — the crash window between them is exactly the replay window. The server half fails when elicitation resolution state is held in process memory or TTL'd independently of the event log retention window; the event log outlives the resolution record, producing orphaned references. The condition is *invalid* — i.e., the failure is live — whenever: (1) elicitation outcomes are not durably recorded client-side, or (2) server elicitation-resolution retention < event-log retention, or (3) the elicitation result POST is not idempotent on `requestId` at the server. Any one of these three is sufficient to trigger divergence. They are independent, and most implementations get at least one wrong. ## Decision Boundary The boundary is where you must choose between two architectures, and you cannot straddle it: - **Replay-safe (idempotent) elicitation:** treat `elicitation/create` as a *replayable event* whose resolution is itself a durable, idempotent state transition keyed on `requestId`. The client persists `{requestId → outcome}` in the same transactional store as the cursor; on replay it re-delivers the event to a gate that checks the ledger first and short-circuits to the recorded outcome without re-prompting. The server retains resolution records ≥ event-log retention and treats a duplicate result POST as a no-op returning the original outcome. This is the only configuration where resumption is correct. - **Non-replayable elicitation (forbidden under resumable SSE):** treat elicitation as a fire-and-forget side channel outside the event log. This is what most servers do because it is simpler, and it is *incompatible* with advertising `Last-Event-ID` resumption. If you take this path you must disable resumption for any stream that may carry elicitations, forcing a fresh session on drop — trading continuity for correctness. The decision point is concrete: **if your server emits `elicitation/create` on a stream whose events carry `id`s, you have implicitly promised replay-safe elicitation.** If you have not built the ledger and the retention guarantee, you have made a promise you will break at the worst moment — mid-task, after a human has already committed a decision. ## Operational Effect In practice this manifests as three distinct symptoms that operators misdiagnose as separate bugs: 1. **Duplicate irreversible actions** (double overwrite, double payment, double delete) traced to a replayed elicitation that was re-approved because the client forgot it had been approved. The human's second "yes" is not a bug in the human; it is the transport re-asking a question it had no right to re-ask. 2. **Silent task aborts** where the client's state machine maps an elicitation error (orphaned reference after server TTL) to the decline branch. The operator sees a task that "just stopped" with no error, because the decline path is a normal control-flow branch, not an exception. 3. **Hung tasks** where the client re-POSTs a duplicate elicitation result, the server rejects it as already-resolved, and the client — which correlates the pending tool call on the elicitation outcome — waits forever for a resolution event the server will never re-emit because it considers `e-07` closed. The architectural guardrail is a single invariant enforced at both ends: **the elicitation ledger and the SSE cursor are one durability domain.** On the client, one transaction advances the cursor and records the outcome. On the server, resolution retention is derived from event-log retention, never shorter. And the elicitation result handler is idempotent on `requestId`, returning the recorded outcome on replay rather than re-executing or erroring. Absent all three, resumption after a mid-elicitation crash is not a continuity feature — it is a duplicate-side-effect generator with a silent-abort fallback. ```python import hashlib from dataclasses import dataclass, field from typing import Literal Outcome = Literal["answered", "declined", "errored"] class ElicitationReplayDivergence(RuntimeError): """Raised when SSE resumption would re-deliver an elicitation whose outcome is not durably recorded, or whose server-side resolution has been garbage-collected beneath the replay cursor.""" @dataclass class DurableCursor: last_event_id: int # The elicitation ledger MUST live in the same durability domain as the # cursor. Persisting them separately opens the crash window that causes # duplicate approvals on replay. elicitation_outcomes: dict[str, Outcome] = field(default_factory=dict) def advance(self, new_event_id: int, elicitation_id: str | None, outcome: Outcome | None) -> None: if elicitation_id is not None: if outcome is None: raise ElicitationReplayDivergence( f"advancing cursor past elicitation {elicitation_id} without an outcome" ) self.elicitation_outcomes[elicitation_id] = outcome self.last_event_id = new_event_id @dataclass class ServerEventLog: events: list[dict] # Resolution records must be retained for >= event-log retention. If a # resolution is TTL'd out while its event is still replayable, resumption # produces an orphaned reference. resolved_elicitation_ttl_ticks: int event_log_retention_ticks: int def check_retention_invariant(self) -> None: if self.resolved_elicitation_ttl_ticks < self.event_log_retention_ticks: raise ElicitationReplayDivergence( "elicitation resolution retention " f"({self.resolved_elicitation_ttl_ticks}) shorter than event-log retention " f"({self.event_log_retention_ticks}); replays will orphan references" ) def resume_stream( client: DurableCursor, server: ServerEventLog, replay_from: int, ) -> list[dict]: """Replay events after a reconnect. Must short-circuit already-resolved elicitations via the client ledger rather than re-delivering them to the human gate.""" server.check_retention_invariant() replayed = [e for e in server.events if e["id"] > replay_from] for event in replayed: if event.get("method") != "elicitation/create": continue eid = event["params"]["requestId"] if eid in client.elicitation_outcomes: # Short-circuit: do NOT re-prompt. The outcome is already committed. continue # No recorded outcome and no way to safely re-derive it: the client # would re-ask a question it may have already answered. raise ElicitationReplayDivergence( f"replay delivered elicitation {eid} with no durable outcome; " "re-prompting risks duplicate side effects" ) return replayed def handle_elicitation_result( server: ServerEventLog, request_id: str, outcome: Outcome, resolution_store: dict[str, Outcome], ) -> Outcome: """Idempotent on request_id. A duplicate POST returns the recorded outcome instead of re-executing or erroring.""" if request_id in resolution_store: return resolution_store[request_id] if not any( e.get("method") == "elicitation/create" and e["params"]["requestId"] == request_id for e in server.events ): raise ElicitationReplayDivergence( f"elicitation result for unknown/expired request {request_id}" ) resolution_store[request_id] = outcome return outcome ```