fix(session): bind a question card's cancel to its prompt - #1034
Merged
Conversation
This was referenced Sep 10, 2026
Cancel on a live question card wrote a blind Escape, so a tap on a card whose gate had already closed interrupted the agent's current turn. On a streamer with raw keys, a card carrying a registry promptId now sends its Escape through /raw-key bound to that prompt, and comes down on the server's reply instead of on the tap. A stale verdict takes the card down as a calm notice with nothing written, and any other refusal keeps the card up with a translated error. Legacy permission and question frames and PTY-scraped cards carry no promptId, so they keep the blind Escape. Interrupting the agent and the raw keyboard's Escape are a different intent and are unchanged. Refs #841
RonenMars
force-pushed
the
fix/permission-cancel-prompt-binding
branch
from
September 10, 2026 15:34
b57cad4 to
f2069d3
Compare
#841 moved the structured card's Cancel from onSendKeys plus onDismissQuestion to a single onCancelQuestion supplied by the owning view. PromptCardSelect still rendered ThinkingBubble and TerminalOutput with only onSendKeys, so its "keeping dismiss" assertion found no Cancel button. Both production callers already pass onCancelQuestion, so only the test's props were stale. Refs #841
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.
Summary
Cancel on a live question card wrote a blind Escape, so tapping it on a card whose gate had already closed interrupted the agent's current turn.
On a streamer with raw keys, a card carrying a registry
promptIdnow sends its Escape through/raw-keybound to that prompt.The card comes down on the server's reply instead of on the tap.
raw_key_staletakes the card down as a calm notice with nothing written, and any other refusal keeps the card up with a translated error.Interrupting the agent and the raw keyboard's Escape are a different intent and are unchanged.
Server dependency
The binding takes effect once the streamer honours
promptIdon escape, tracked in RonenMars/threadbase-streamer#848.Until then a streamer writes the escape blind and answers 200, exactly as it does today, so this is safe to merge before that lands.
Not covered
Legacy permission and question frames and PTY-scraped cards carry no
promptId, so their Cancel keeps the blind Escape.#841 stays open for the PTY-scraped cards.
Tests
main, and removing theclear(expectedKey)guard fails the in-flight replacement test.Refs #841