Skip to content

Answer wrapping AskUserQuestion options (truncated-label match) - #599

Merged
Juliusolsson05 merged 2 commits into
mainfrom
fix/auq-truncated-label-answering
Jul 22, 2026
Merged

Juliusolsson05 merged 2 commits into
mainfrom
fix/auq-truncated-label-answering

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

Pointer bump for claude-code-headless#47.

The bug

Answering an AskUserQuestion option whose label wraps did nothing — option-not-found, zero keystrokes, picker left up. Reproduced end-to-end against a live claude picker:

payload label:  "We should roll the new release out to a small five percent slice of users first and then gradually widen exposure as metrics stay healthy."
screen label:   "We should roll the new release out to a small five percent slice of users"
old driver:     ok:false  option-not-found   keys: []
fixed driver:   writes '1', ok:true, picker closes

The TUI keeps only the first physical line of a wrapping label; the answer payload carries the full semantic label. Exact equality can never match. Verified live that the wrapped continuation and the option's description share the same fg colour, so the parser genuinely cannot rejoin it — the fix lives in matching, not parsing.

Scope

  • agent-code: pointer bump only. No renderer or driver changes here.
  • The submodule PR changes one function (optionBySelection): truncation-tolerant prefix containment instead of exact equality, number check unchanged so ambiguous/stale labels still fail closed.
  • Committed regression test built from a captured 80-col viewport + full labels from the same picker at 160 cols; fails on old driver (2/4), passes on new.

History

This supersedes the reverted AUQ changes from #598, which review proved wrong against a live picker (parser-side label rejoin was a regression; two driver fallbacks answered the wrong question). This version was built live-first and does none of those.

🤖 Generated with Claude Code

Points at the fix for answering a wrapping AskUserQuestion option, which
failed because the screen label is a truncated prefix of the full semantic
label. Renderer/driver code in agent-code is unchanged — the fix is entirely
in the driver's option matching.

Submodule PR: Juliusolsson05/claude-code-headless#47
@Juliusolsson05
Juliusolsson05 merged commit f8126d0 into main Jul 22, 2026
1 check passed
@Juliusolsson05
Juliusolsson05 deleted the fix/auq-truncated-label-answering branch July 22, 2026 23:33
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