Repository navigation
feat: detect opencode question prompts as waiting_input - #346
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.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.
Merge risk
Note
Low - can be merged without reading the diff. The new pattern was checked against the current opencode TUI source (both the released and the development line), and unit tests cover it. It only adds a
waiting_inputmatch, and a revert fully undoes it. It has not been exercised against a live opencode session (see Verification).Summary
esc dismiss, oresc closewhile editing a custom answer) aswaiting_input.△ Permission required) and busy (esc interrupt/esc again to interrupt) patterns still match current opencode and are unchanged.Problem
opencode added a prompt that asks the user questions and blocks until they answer, separate from the permission prompt. The detector only recognised the permission prompt, so sessions waiting on a question did not show as waiting.
The footer text comes from opencode's source:
v1.19.3(npmlatest):packages/tui/src/routes/session/question.tsx:509rendersesc dismiss.dev(2.0.32):packages/tui/src/routes/session/form.tsx:1166rendersesc dismiss, oresc closewhile editing.Neither text appears anywhere else in the TUI in either version.
Verification
bunx vitest run src/services/stateDetector/opencode.test.ts→Tests 10 passed (10), including 3 new cases (question prompt, question prompt while editing,esc again to interrupt).bun run lintandbun run typecheck→ no errors.bun run test→ 8 failures, all in*.submodule.test.tsandsrc/e2e/returnToMenu.test.ts; the same 8 fail with this change reverted, so they are unrelated.🤖 Generated with Claude Code