Skip to content

feat: detect opencode question prompts as waiting_input - #346

Merged
kbwo merged 1 commit into
mainfrom
feat/update-opencode-strategy-latest
Oct 17, 2026
Merged

kbwo merged 1 commit into
mainfrom
feat/update-opencode-strategy-latest

Conversation

@kbwo

@kbwo kbwo commented Oct 17, 2026

Copy link
Copy Markdown
Owner

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_input match, and a revert fully undoes it. It has not been exercised against a live opencode session (see Verification).

Summary

  • When opencode asks the user a question (its question/form prompt), ccmanager reported the session as idle or busy instead of waiting for input.
  • The opencode state detector now treats the prompt's footer (esc dismiss, or esc close while editing a custom answer) as waiting_input.
  • The existing permission (△ 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 (npm latest): packages/tui/src/routes/session/question.tsx:509 renders esc dismiss.
  • dev (2.0.32): packages/tui/src/routes/session/form.tsx:1166 renders esc dismiss, or esc close while 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 lint and bun run typecheck → no errors.
  • bun run test → 8 failures, all in *.submodule.test.ts and src/e2e/returnToMenu.test.ts; the same 8 fail with this change reverted, so they are unrelated.
  • A live opencode session under ccmanager reaching a question prompt was not run: triggering the prompt needs a real model call through a configured provider.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@kbwo
kbwo marked this pull request as ready for review October 17, 2026 14:41
@kbwo
kbwo merged commit 93c2d90 into main Oct 17, 2026
1 check passed
@kbwo
kbwo deleted the feat/update-opencode-strategy-latest branch October 17, 2026 14:41
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