fix(acp): handle question.asked event to prevent hanging#17921
Conversation
When OpenCode runs via ACP, the question tool would hang indefinitely because the question.asked event was not handled in the ACP agent. This change adds a handler for question.asked that: - Converts question options to ACP requestPermission options - Forwards the question to the ACP client via requestPermission - Maps the response back to question answers - Calls the SDK question.reply to unblock the tool Fixes anomalyco#17920
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: Related PR:
The current PR #17921 is appropriately addressing a specific issue (issue #17920) with the question tool hanging in ACP, so this appears to be a targeted fix rather than a duplicate. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #17920
Type of change
What does this PR do?
When OpenCode runs via ACP, the
questiontool would hang indefinitely because thequestion.askedevent was not handled in the ACP agent'shandleEventmethod.The fix adds a new case handler for
question.askedthat:requestPermissionoptionsrequestPermissionquestion.reply()orquestion.reject()to unblock the toolThis follows the same pattern as the existing
permission.askedhandler.How did you verify your code works?
bun run --cwd packages/opencode typecheck- passespermission.askedhandler pattern which is proven to workScreenshots / recordings
N/A - This is a backend change, no UI changes.
Checklist