fix: support ACP question prompts via extMethod#20017
fix: support ACP question prompts via extMethod#20017hikaruczl wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Potential Related PR Found: Relationship: This earlier PR addresses question tool support in ACP mode. The current PR (20017) builds upon this by adding support for ACP question prompts via the |
|
Thanks — I checked #18657 and it does overlap with the same ACP The main difference is approach:
I took the extension-based approach intentionally because So this PR is meant as an alternative design for the same bug, not an independent feature. If maintainers prefer the minimal |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
I prefer extension-based way because it allows user to input custom text compared to hope this pr could be merged ASAP |
Issue for this PR
Closes #17920
Type of change
What does this PR do?
ACP mode was still exposing a gap around the
questiontool: the tool can be opt-in enabled, but ACP had no bridge forquestion.asked, so ACP sessions could not complete the question/reply flow.This PR keeps the default ACP behavior unchanged and only enables ACP question prompts when both of these are true:
OPENCODE_ENABLE_QUESTION_TOOL=1_meta["opencode/question"]When that capability is present,
packages/opencode/src/acp/agent.tsforwardsquestion.askedto the ACP client throughextMethod("opencode/question", ...), then maps the response back to the existingsdk.question.reply(...)/sdk.question.reject(...)APIs.I also updated the ACP README with the extension contract and added targeted event-subscription coverage for both reply and reject flows.
I chose the ACP extension route instead of
requestPermission()because question prompts are not the same thing as permission prompts, and I wanted the ACP bridge to use an explicit, capability-gated question path.How did you verify your code works?
I tested locally with:
bun test ./test/acp/event-subscription.test.tsbun test ./test/tool/question.test.tsbun test ./test/acp/agent-interface.test.tsbun run typecheckScreenshots / recordings
N/A
Checklist