GeezerVison is showing github.com — feat(acp): enable question tool for ACP clients by Leoyzen · Pull Request #13750 · anomalyco/opencode
Conversation
Leoyzen
commented
Feb 15, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Enable question tool support for ACP (Agent Client Protocol) clients like Zed. This allows ACP-compatible editors to handle AI assistant questions through their native permission UI.
Fixes #13752
What Changed
For ACP Users (Zed, etc.)
When the AI assistant asks a question (e.g., "Which test file should I create?"), ACP clients now display it as a native permission prompt with selectable options:
┌─────────────────────────────────────────┐
│ Create test file? │
│ │
│ ○ Unit tests (recommended) │
│ ○ Integration tests │
│ ○ Skip this step │
│ │
│ [Cancel] │
└─────────────────────────────────────────┘
Implementation Details
-
Registry Update - QuestionTool is now available for ACP mode
- Previously only available for
app, cli, desktop clients
- Now includes
acp client type
-
Event Handler - New question.asked event handler in ACP Agent
- Maps question options to ACP
PermissionOption format
- Generates unique option IDs from labels (kebab-case)
- Always includes a "Cancel" option for dismissal
- Uses existing permission queue for sequential per-session handling
-
Response Flow
- User selects an option → calls
sdk.question.reply() with the label
- User clicks Cancel → calls
sdk.question.reject()
- Errors → gracefully rejected to prevent hanging promises
Scope & Limitations
This implements Phase 1 with the following constraints:
- ✅ Single-select only (first question if multiple)
- ✅ No text input (custom answers)
- ✅ Multiple options supported (array-based)
- ✅ Cancellation always available
Multi-select and text input support will come in a future update.
Testing
- 6 new integration tests in
test/acp/question.test.ts
- All existing ACP tests pass (no regressions)
bun test test/acp/ - 12 tests passing
Verification
# Run ACP tests
bun test packages/opencode/test/acp/question.test.ts
# Type check
bun run typecheck
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
nineluj, monken, and JasonLandbridge reacted with thumbs up emoji
Add test suite for ACP question tool mapping:
- question.asked event triggers requestPermission
- Option mapping from question to permission format
- User selection handling with sdk.question.reply
- User cancellation handling with sdk.question.reject
- Multiple questions uses only first question (Phase 1)
- Dismissed outcome rejection handling
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <[email protected]>
Enable QuestionTool for ACP client mode by adding "acp" to the
Flag.OPENCODE_CLIENT check alongside existing "app", "cli", "desktop".
This allows ACP clients (like Zed) to use the question tool and see
question events mapped to native permission UI.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <[email protected]>
Add question.asked event handler to ACP Agent:
- Maps question options to PermissionOption format
- Always includes Cancel option with reject_once kind
- Uses permission queue for sequential per-session handling
- Calls sdk.question.reply when user selects an option
- Calls sdk.question.reject when user cancels or on error
- Supports single-select only (Phase 1), uses first question
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <[email protected]>
|
Thanks for your contribution!
This PR doesn't have a linked issue. All PRs must reference an existing issue.
Please:
- Open an issue describing the bug/feature (if one doesn't exist)
- Add
Fixes #<number> or Closes #<number> to this PR description
See CONTRIBUTING.md for details.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The following comment was made by an LLM, it may be inaccurate:
Based on my search, I found a potential related PR:
Related PR:
This PR appears to be related to your current PR #13750 as it also addresses ACP question tool functionality. The PR #13562 involves adding an opt-in flag for the question tool, which may be complementary or overlapping with the feature being enabled in PR #13750.
You should verify if #13562 is:
- A duplicate implementation of the same feature
- A previous attempt that should be superseded
- A related feature that should be coordinated
Otherwise, no duplicate PRs were found with the exact same scope.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Modify question.asked handler to support multi-question scenarios:
- Call request_permission separately for each question
- Use index suffix for unique toolCallId (question-id-0, question-id-1...)
- Collect all answers and reply once after last question
- Maintain permission queue for sequential execution
This allows ACP clients like Zed to display questions sequentially,
with users answering one at a time.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <[email protected]>
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Mar 3, 2026
|
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|