Skip to content

fix(claude-tty): keep a question card open in a turn held for background work - #157

Merged
sleeyax merged 1 commit into
mainfrom
fix/claude-tty-question-in-held-turn
Oct 21, 2026
Merged

sleeyax merged 1 commit into
mainfrom
fix/claude-tty-question-in-held-turn

Conversation

@sleeyax

@sleeyax sleeyax commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Summary

Answering an AskUserQuestion card failed with PreToolUse:AskUserQuestion hook error: The user left these questions to be asked in chat…, and Claude then asked every question again in chat.
It happens when a background agent's report wakes Claude inside a turn held open for it, and the person takes more than five minutes to answer.

The hold ends the turn after five minutes in which Claude writes nothing (SUBAGENT_WAKE_MS).
Claude writes nothing while it waits on a card, so the bound ran out under the open card, the turn ended, cancelPending cancelled the card, and the hook returned the ask-in-chat fallback.
The answers the plugin wrote a moment later were never read.

 reviewBackgroundHold
+  if a card Claude is held up behind is open
+    keep waiting
   if Claude wrote something within the wake bound
     keep waiting
   …
   end the turn

 answerProgressAt
   max(subagent, shell, assistant activity,
+      when the last blocking card was answered,
       when the hold began)

Evidence

From the session that hit it (adapter log and Claude's transcript, UTC):

Time Event
12:21:53 Turn held for 1 background agent
12:30:01 Agent's task notification wakes Claude
12:30:16 Claude calls AskUserQuestion
12:35:08 Ending a turn Claude never answered its background work in, silentMs: 303086; hook returns the fallback
12:35:09 Submit writes the answers file, which is never read

New test goes on waiting while the question Claude asked for the agent that reported is still being answered:

hold a turn for an agent, agent reports, Claude asks a question
wait 4× the wake bound          → turn still open
answer the card                 → hook allows with the answer
wait briefly                    → turn still open
Stop hook                       → turn ends
  • Before: fails at the first turn still open check, because the turn has already ended.
  • After: passes, along with the rest of the adapter suite (253 tests), and tsc --noEmit is clean.

Merge Danger

Door: two-way

Blast Radius: held turns

A held turn now stays open for as long as a blocking card is unanswered, so a session with an unanswered card in a held turn reads as busy until someone answers it or cancels.
Turns that aren't held for background work are unaffected.

…und work

A turn held open for a background agent ends once Claude has written nothing for five minutes.
When the agent's report woke Claude and it asked a question, Claude wrote nothing while the person answered, so after five minutes the turn ended, the card was cancelled and Claude was told to ask in chat instead.
The hold now waits as long as a card Claude is held up behind is open, and counts the five minutes from the moment it is answered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sleeyax
sleeyax merged commit 3af2e78 into main Oct 21, 2026
1 check passed
@github-actions github-actions Bot mentioned this pull request Oct 14, 2026
DoctorJacoby added a commit to DoctorJacoby/paseo-plugins that referenced this pull request Oct 21, 2026
… asks it now

The test raised its card from PreToolUse, which no longer opens one for a
question. It now sends PreToolUse and then the PermissionRequest that
carries the card, and reads the PermissionRequest's decision.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant