fix: replace WAITING_USER_ANSWER regex to prevent stale scrollback false positives#142
Merged
haofeif merged 3 commits intoawslabs:mainfrom Apr 2, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #142 +/- ##
=======================================
Coverage ? 90.61%
=======================================
Files ? 44
Lines ? 3708
Branches ? 0
=======================================
Hits ? 3360
Misses ? 348
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
haofeif
approved these changes
Apr 2, 2026
Contributor
haofeif
left a comment
There was a problem hiding this comment.
Thanks @patricka3125 LGTM
erikmackinnon
pushed a commit
to erikmackinnon/cli-agent-orchestrator
that referenced
this pull request
Apr 3, 2026
…lse positives (awslabs#142) * fix WAITING_USER_ANSWER regex * formatting --------- Co-authored-by: haofeif <56006724+haofeif@users.noreply.github.com>
patricka3125
added a commit
to patricka3125/cli-agent-orchestrator
that referenced
this pull request
Apr 3, 2026
…lse positives (awslabs#142) * fix WAITING_USER_ANSWER regex * formatting --------- Co-authored-by: haofeif <56006724+haofeif@users.noreply.github.com>
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
WAITING_USER_ANSWERdetection in the Claude Code provider being permanently triggered by stale scrollback history after a user answers a selection prompt❯.*\d+\.) with the Ink TUI footer (↑/↓ to navigate) that is only present while a selection widget is actively mountedWAITING_USER_ANSWERProblem
The old regex
❯.*\d+\.matched numbered selection options (e.g.,❯ 1. Allow once) against the entire tmux capture buffer. After a user answered a prompt, the text persisted in scrollback, causingget_status()to permanently returnWAITING_USER_ANSWER. This blocked inbox message delivery insend_message/assignflows — the input queuing bypass treatsWAITING_USER_ANSWERas a delivery block, so messages stayedPENDINGforever.On Claude Code 2.1.90, below is a screenshot showing symptoms of this issue occurring.
Terminal status as seen on the Web UI

Here are screenshots of what the Claude Code Ask user widget actually looks


Solution
The Claude Code Ink TUI renders a navigation footer (
Enter to select · ↑/↓ to navigate · Esc to cancel) only while a selection widget is mounted. The footer disappears the instant the user makes a selection. Matching on↑/↓ to navigateeliminates the stale-scrollback false positive while correctly detecting active prompts.Handoff mode is unaffected — it bypasses the inbox system entirely.
Test plan
test_get_status_stale_scrollback_not_waiting_user_answer— verifies stale numbered scrollback returnsCOMPLETED, notWAITING_USER_ANSWERuv run pytest test/ --ignore=test/e2e -v