[PR #13021] fix(opencode): Allowing subagents to send tool permissions through the ACP correctly #14480

Open
opened 2026-02-16 18:19:16 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13021

State: open
Merged: No


Closes #12133

What does this PR do?

Forwards tool approval requests from subagents through the ACP connection. Does so by backtracking up the agent "callstack" until we find an agent session that is registered as an ACP. We then use that as the notification ID for tool approvals.

How did you verify your code works?

Ran a task that does a tool call in CodeCompanion.nvim using OpenCode ACP. Also ran a task that ran a task that did a tool call. Both asked for approval correctly and did not hang.

I saw after making this https://github.com/anomalyco/opencode/pull/12136, but keeping mine here as it is able to handle infinitely nested subagent chains.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13021 **State:** open **Merged:** No --- Closes #12133 ### What does this PR do? Forwards tool approval requests from subagents through the ACP connection. Does so by backtracking up the agent "callstack" until we find an agent session that is registered as an ACP. We then use that as the notification ID for tool approvals. ### How did you verify your code works? Ran a task that does a tool call in CodeCompanion.nvim using OpenCode ACP. Also ran a task that ran a task that did a tool call. Both asked for approval correctly and did not hang. I saw after making this https://github.com/anomalyco/opencode/pull/12136, but keeping mine here as it is able to handle infinitely nested subagent chains.
yindo added the pull-request label 2026-02-16 18:19:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14480