What happens when an instance suspends a tool call for MCP elicitation and the sampling loop resumes against a mutated conversation prefix
**Date of Record:** 2026 December 2 **Scope:** Applies to MCP hosts where a server issues `elicitation/create` (or any server-initiated user-input request) *during* a tool invocation, and the host model's tool-call turn is suspended pending the human response. Does not apply to elicitation issued before a tool call begins, nor to fire-and-forget notification-style server requests.
Core Distinction
The failure here is not "the user took too long" or "the request timed out." It is a **prefix-mutation race**: elicitation is a *synchronous suspension of the assistant's tool-call turn* that is resolved by an *asynchronous external input* (the human), and the host resumes the model turn by replaying or continuing a conversation whose prefix has, in the interim, been mutated by other events. The model that resumes is not the model that suspended, even when it is literally the same weights — because the context it resumes against now contains a different tail than the one it left.
The non-obvious part: MCP elicitation is specified as a request/response pair *on the transport*, but the host must decide **what the resumption point is in the model's token stream**. There is no canonical answer in the protocol, and the two plausible answers — (a) splice the elicitation result into the pending tool-result slot and continue, or (b) treat the elicitation as a new user turn appended after the tool call — produce different, non-equivalent continuations. Most hosts pick (a) implicitly and then discover that the tool call they are resuming was already *superseded* by a sibling call, a compaction pass, or a queued user message.
What Was Observed
A host was running a `deploy_service` tool call against an MCP server. Mid-execution the server emitted `elicitation/create` requesting a target environment confirmation. The host:
- Suspended the assistant turn at the tool-call block, recording `pending_tool_call_id = tc_8812`.
- Surfaced the elicitation to the user.
- While waiting (~40s), the user typed an unrelated message ("actually also bump the replicas to 3") which the host appended as a new user turn.
- The user then answered the elicitation with `"staging"`.
- The host spliced the elicitation result into the `tc_8812` tool-result slot and resumed generation.
The resumed model saw a transcript of the form:
assistant: [tool_call tc_8812 deploy_service ...]
user: actually also bump the replicas to 3
tool_result tc_8812: {"elicitation_response": "staging"}
The model, reading top-to-bottom, interpreted the elicitation result as a *reply to the intervening user message* rather than a *completion of the tool call*. It emitted a tool call `scale_replicas(service=?, replicas=3)` with an **empty service argument** — because the service identity lived only inside the suspended `deploy_service` arguments, which the model no longer treated as in-flight. The deployment proceeded against a default service, and the replica bump hit the wrong workload.
Three distinct mechanisms compounded:
- **Slot misalignment.** The tool-result slot for `tc_8812` was populated, but the immediately preceding turn was a user message, not the assistant tool-call block. The protocol-level correlation ID is invisible to the model; only positional adjacency signals "this result answers that call."
- **Argument amnesia.** The suspended call's arguments are not re-surfaced on resumption. The model must re-derive them from context, and the intervening user turn displaced the attention anchor.
- **Elicitation-as-turn confusion.** The model has no reliable way to distinguish "an elicitation response is a tool result" from "an elicitation response is a user message," because in most training distributions the two are textually identical.
Condition of Validity
The invariant that must hold for safe resumption is:
> **The conversation prefix at resumption must be byte-identical to the prefix at suspension, modulo the single tool-result slot being filled.**
This is stronger than it sounds. It forbids:
- Any user message appended between suspension and resumption.
- Any sibling tool call completing and landing its result in the interim (parallel tool calls are the common trigger).
- Any context-compaction, summarization, or truncation pass running while the turn is suspended — because compaction rewrites the prefix, and the tool-result slot may be relocated or elided.
- Any system-prompt or tool-schema mutation (e.g., a tool being added/removed) between suspension and resumption, since that shifts the tokenized function-call grammar.
If any of these occur, the host must **not** splice-and-resume. It must instead **re-issue the tool call** with the elicitation result folded into the arguments, as a fresh assistant turn. The distinction is: splice-and-resume assumes prefix stability; re-issue assumes prefix mutation and rebuilds the call from scratch.
The failure is silent because both paths produce syntactically valid continuations. There is no exception, no schema violation, no transport error. The model simply reasons against a context that no longer means what it meant.
Decision Boundary
The host must maintain, per suspended tool call, a **prefix fingerprint** captured at suspension: a hash over (message list, tool schema set, system prompt, model ID). On elicitation resolution:
- If fingerprint matches current state → splice the result into the `pending_tool_call_id` slot and continue. Safe.
- If fingerprint differs → do **not** splice. Reconstruct the tool call: take the original arguments, merge the elicitation response, emit a *new* assistant tool-call turn, and let the model proceed without a dangling `pending_tool_call_id`.
- If the elicitation itself mutated the tool arguments (the common case — "which environment?" changes the target), the result must be merged into arguments *before* re-issue, and the original `pending_tool_call_id` must be retired, not reused. Reusing the ID is what produced the slot misalignment above: the model saw a result for a call whose arguments it had already been told to forget.
A second boundary: elicitation responses must be **tagged as tool results, not user turns**, in the model-visible transcript. The transport-level `elicitation/create` is a *server→client* request, but its resolution is a *tool result* from the model's perspective. Hosts that render it as a user message (because it came from a human) corrupt the role structure.
Operational Effect
The practical consequence is that elicitation introduces a **suspension window during which the agent's context is not frozen but the agent's turn is**. Every event that lands in that window — user interjections, parallel tool completions, scheduled compaction — is a potential prefix mutation that invalidates splice-and-resume. Systems that treat elicitation as "just another tool result" will pass tests where the user answers promptly and nothing else happens, and will fail in production where the window is 30–60 seconds and the user is multitasking.
The guardrail is a fingerprint check plus a mandatory re-issue path. It costs one hash comparison per resumption and one extra model turn in the mutated case. The alternative — trusting that the prefix is stable — produces continuations that are locally coherent and globally wrong, which is the worst failure class for an agent: it does not crash, it does the wrong thing confidently.
import hashlib
import json
from dataclasses import dataclass, field
from typing import Any
class PrefixMutationError(RuntimeError):
"""Raised when a suspended tool call is resumed against a mutated prefix."""
@dataclass
class SuspendedCall:
tool_call_id: str
tool_name: str
arguments: dict[str, Any]
prefix_fingerprint: str
def fingerprint(messages: list[dict], tool_schemas: list[dict], system: str, model_id: str) -> str:
payload = json.dumps(
{"messages": messages, "tools": tool_schemas, "system": system, "model": model_id},
sort_keys=True,
separators=(",", ":"),
).encode("utf-8")
return hashlib.sha256(payload).hexdigest()
def resolve_elicitation(
suspended: SuspendedCall,
elicitation_response: dict[str, Any],
current_messages: list[dict],
current_tool_schemas: list[dict],
current_system: str,
current_model_id: str,
) -> dict[str, Any]:
current_fp = fingerprint(current_messages, current_tool_schemas, current_system, current_model_id)
merged_args = {**suspended.arguments, **elicitation_response}
if current_fp == suspended.prefix_fingerprint:
# Prefix stable: splice into the pending slot and continue.
return {
"mode": "splice",
"tool_call_id": suspended.tool_call_id,
"arguments": merged_args,
}
# Prefix mutated: splicing would misalign the tool-result slot.
# Re-issue as a fresh call with a new ID; retire the old one.
if suspended.tool_call_id in json.dumps(current_messages):
# A dangling reference to the retired call still exists in context.
# Continuing would let the model treat the new result as answering the old call.
raise PrefixMutationError(
f"Tool call {suspended.tool_call_id} ({suspended.tool_name}) suspended against "
f"prefix {suspended.prefix_fingerprint[:12]}, resumed against {current_fp[:12]}; "
f"intervening events mutated the transcript. Re-issuing with merged arguments "
f"{merged_args!r} under a new tool_call_id; caller must strip the stale reference "
f"before generation continues."
)
return {
"mode": "reissue",
"tool_call_id": f"{suspended.tool_call_id}_reissued",
"arguments": merged_args,
}