Skip to content

fix(acp): handle question.asked event to prevent hanging#17921

Open
Meskjei wants to merge 1 commit intoanomalyco:devfrom
Meskjei:fix/acp-question-tool
Open

fix(acp): handle question.asked event to prevent hanging#17921
Meskjei wants to merge 1 commit intoanomalyco:devfrom
Meskjei:fix/acp-question-tool

Conversation

@Meskjei
Copy link
Copy Markdown

@Meskjei Meskjei commented Mar 17, 2026

Issue for this PR

Closes #17920

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When OpenCode runs via ACP, the question tool would hang indefinitely because the question.asked event was not handled in the ACP agent's handleEvent method.

The fix adds a new case handler for question.asked that:

  1. Converts question options to ACP requestPermission options
  2. Forwards the question to the ACP client via requestPermission
  3. Maps the client's response back to question answers
  4. Calls the SDK's question.reply() or question.reject() to unblock the tool

This follows the same pattern as the existing permission.asked handler.

How did you verify your code works?

  • Ran bun run --cwd packages/opencode typecheck - passes
  • The change follows the existing permission.asked handler pattern which is proven to work

Screenshots / recordings

N/A - This is a backend change, no UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

Related PR:

  • feat(acp): enable question tool for ACP clients #13750 - feat(acp): enable question tool for ACP clients
    • This PR is related as it previously enabled the question tool for ACP clients. Your PR (17921) extends that work by specifically handling the question.asked event to prevent hanging, which appears to be a follow-up fix to the earlier feature implementation.

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.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

Question tool hangs in ACP mode

1 participant