fix(chat): harden the wait handover against model slips - #75
Merged
Merged
Conversation
A Haiku run sent wait_for_user_action a message ending in its own other arguments as escaped JSON, with literal \n sequences, and the person read the JSON tail as the handover. The message is cut where the swallowed arguments begin, they are recovered for the wait itself, and literal \n become line breaks, both where the message is shown and where it runs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A persona that clicked a chat link and looked straight away read the page before the route changed, told the assistant the link did nothing, and the assistant apologised for a link the application had reported as followed. A look following a click or typing now reads until two consecutive snapshots agree, within 3 seconds; other looks read once. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…y its action caused Acting on a declared wait and writing happen in one persona pass, so the message was composed before the assistant reacted. Judged runs had the persona ask what had just been created under the reply that said so, and the stale message interrupted the next wait. When the action changed the conversation, the message is dropped and the persona asked again. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ssage starts The instruction to declare wait_for_user_action again after an interrupted wait lived in that wait's tool result, which sits in history ahead of the person's new message. Judged runs, Sonnet and Haiku alike, answered the question and never waited again, so the action they had handed over went unseen. The reminder now closes the new turn's hidden context. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The schema requires the message but the SDK does not enforce it: a Haiku run called wait_for_user_action with no arguments, the turn went silent, and the person, told nothing, had to ask what to do. The wait is refused with an error the model retries from. Tests and the mock model now send a message, as real calls do. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hardens the
wait_for_user_actionhandover against slips seen in judged simulations, and makes the simulation harness more faithful.Why: judged runs showed silent handovers, a garbled handover message, and assistants answering the person's question then never waiting again, so what they handed over went unseen.
Heads-up:
messageis now refused; hosts and prompts should rely on the message.