Repository navigation
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…-transcript # Conflicts: # CHANGELOG.md
…screen Seen live on Claude Code 2.1.286: a turn's second AskUserQuestion was not in the transcript while its dialog was up, so the answered first call took its card away. An answered call now only rules out its own dialog still on screen.
…-transcript # Conflicts: # CHANGELOG.md
devswha
marked this pull request as draft
October 1, 2026 10:12
Owner
Author
|
Closing without merging. On Claude Code 2.1.286 the pending question is not in the session file until it is answered, so this path does not fire, and it adds about 220 lines to code that sends keys. The finding is recorded on #211. The branch stays in case a later Claude writes the call while it waits. |
10 tasks
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.
Closes #211
Read this first: what real Claude Code 2.1.286 does
The issue asked to verify when Claude writes the
tool_useto its transcript. On 2.1.286 it writes an AskUserQuestion call only once it is answered: in three real dialogs (a session's first question, and a turn's second question twice) the file did not change while the dialog was up. So on this version the pending call is never in the file while the card is needed, the screen is still what gets read, and a real cut-off dialog still gets only the last-resort card. This PR is correct and safe for a Claude that does write the call while it waits, and changes nothing harmful for one that does not, but it does not fix #140 on 2.1.286. A source that has the call while it is pending (Claude's PreToolUse hook gets the tool input) would be the next step; that is not in this PR.What changes
Claude Code's AskUserQuestion, its answer review and the plan approval are tool calls, so their text is in the session transcript. The card's questions, options, descriptions and plan now come from the pending
tool_usethere, and the screen only says where the dialog stands (which question, which row has the cursor, which boxes are checked, whether it is still the last thing on screen). This follows the shape of the omo cards from #237.When a card is offered
All of these must hold:
claude. A shell, Codex or gjc pane showing the same text gets nothing.claude-store.ts) has an AskUserQuestion or ExitPlanMode call in the current turn with notool_result.The transcript has three answers, and each is handled differently:
The last two rows exist because of the finding above: a transcript without the call cannot mean "no dialog". The first version of this branch treated an answered call as "no card", and the real run then showed a turn's second question losing its card to the last-resort one; that is fixed and tested.
Prompt ids are still content hashes, a stale answer still gets 409
prompt_changed, and answers are stillsend_keysnavigation from the cursor on screen. Tool approvals and the unnumbered menus are untouched.Cost on the 2 s poll: the transcript is looked at only while the screen shows one of the three dialogs; that costs one
agent.getand onestat. The file's last 1 MiB is read again only when its size or mtime changed.Before / after
The same tests on main's
server/prompt.tsand on this branch (HERDR_TEST_MODE=unit bun test ./server/prompt.test.ts -t "Claude's dialogs on a prompt poll"):Before: 3 pass, 5 fail. After: 8 pass.
Real Claude Code 2.1.286, isolated test pane
One session, two AskUserQuestion calls in one turn, driven only through
/api/pane/promptand/api/pane/prompt/answer: the folder-trust card answered 200; "Color" got its card and the answer 200; "Storage" got its question card (not the last-resort one), a wrong prompt id got 409, the answer 200; the transcript's tool results then read"Pick a color"="Green"and…="In-memory cache", and no card was left. Both question cards were read from the screen (descriptions cut at the wrap), because the calls were not in the file.Contract test against real herdr (
server/prompt.contract.test.ts): a pane shows only rows 3 to 6 of a question. Before it got the last-resort card (fallback: true); after it gets the question's own card with all four options, and answering the first one (above the screen's top) lands on that row.Commands
Limits