Repository navigation
Conversation
…ion form A form taller than the terminal loses its tab bar and question, and stale scrollback above it supplied another tab's question, so clients could get a card that mixed two tabs. A preview form produced option labels with the preview box in them. Both now report a live question with an empty list, so the push and the later close still happen and no card is opened.
…e screen A tab is returned only when its question text, option labels and single cursor match the prompt's questions. A scrolled or preview form is reported as such, and anything else that does not match reads as null.
Every key is planned from the screen as it is, and the next one is written only after the screen shows what that key should have done. Answers are checked before the first byte, and the review must list exactly the chosen options before it is submitted. A stop after the first byte is reported as partial, since a key cannot be taken back.
`POST /api/sessions/:id/prompt/answer` now answers a Claude Code form with more than one question, one verified key at a time. Every response is validated before the first byte, and a refusal writes nothing. While the form is driven, no other writer can reach the session, and screen and transcript prompt events are dropped. A form that scrolled gets a terminal 100 rows tall, and the previous size is restored afterwards. A first question that is not on screen answers 409 `form_not_ready` and leaves the prompt open. A stop after the first key answers 409 `partly_answered`, which is not retryable: the user finishes the form in the terminal. `/api/info` advertises `promptContract.multiQuestion`. Refs #1044
A mutation pass showed which guards in the form answer path no test depended on, so each now has one. The answered-question hook is removed because the existing menu-gone callback already closes the push notification. The tab bar position check is removed because a bar below the footer leaves no rows to read. Refs #1044
… list Claude Code clears the screen and repaints it in several chunks after a resize. A read between them found no menu and cancelled the pending question, so its answer got 409 prompt_cancelled. The screen is now left unread for 300 ms after a size change, except for OSC 777 notifications. At 12 rows the option list can scroll while the tab bar and question stay, with no "more line" row. That frame raised a card with options missing and never grew the terminal. A form now counts as unreadable when the rows above "Chat about this" do not number down to 1. Refs #1044
This was referenced Nov 26, 2026
This was referenced Dec 5, 2026
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
POST /api/sessions/:id/prompt/answercan now answer a Claude CodeAskUserQuestionform with several questions.The request body is unchanged, and
promptContract.multiQuestion: trueadvertises the support.form_not_ready(nothing written, the prompt stays open) andpartly_answered(some keys written, not retryable, finish in the terminal).atomicAnswer: truestays, andpartly_answeredis its one documented exception.This covers both overflow layouts: a
more linerow, and a scrolled option list under a tab bar that stays put.terminal_resizetwice around an answer.This also fixes a bug that is on
maintoday.A terminal resize while a question was pending could cancel it, so its answer got 409
prompt_cancelled.Claude Code repaints in several chunks after a resize, and a read between them saw no menu.
The screen is now left unread for 300 ms after a size change, except for OSC 777 notifications.
Refs #1044
Evidence
main'spty-manager.ts.A real run at 30 rows got 409
prompt_cancelled3 out of 3 times on this branch without the fix.At 12 rows, before the scrolled-list fix, the answer got 409
form_not_ready2 out of 2 times with nothing typed.Replaying those recordings through the old detector gives a card with options missing.
After: real runs against Claude Code 2.1.332, comparing the transcript's recorded answers with the chosen options.
npm run buildandnpm run lintexit 0 (30 warnings, 10 infos).Not verified:
Known limits:
partly_answered, a form finished in the terminal unlocks the composer only at the next 60 second check.maindoes not yet handlepartly_answered,form_not_readyormultiQuestion; that is the next part of the work.Merge Danger
Door: two-way.
The change is additive on the wire and adds no schema or stored data.
An answer that has already typed into a terminal cannot be taken back, which is why every key is checked against the screen before the next one.
Blast Radius: Claude sessions.
The input lock sits in
LiveSessionManager, which every provider goes through, but only a multi-question answer takes it.The resize hold and the unreadable-form check change how every Claude screen is read.