anomalyco / anomalyco/opencode

ACP drops permission requests from Task subagent sessions

Open
#48,232 2 comments 1 reaction 1 assignee View on GitHub

@jlongster is already working on this.

Since Sep 9, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

When OpenCode runs as an ACP agent, a permission request from a Task subagent is never forwarded to the connected ACP client. The subagent then waits indefinitely for a reply the client cannot send.

This still reproduces on dev (1.18.30).

The global ACP event subscription forwards permission.asked to the permission handler. The handler then looks up the event sessionID in the ACP session store and returns early when it is absent.

The store contains only sessions created through ACP session/new, session/load, session/resume, or session/fork. A Task subagent has its own session ID and is created outside that store, so its permission request is dropped without either forwarding it to the client or replying to OpenCode.

The same missing child-session mapping also causes child tool and text events to be invisible to ACP clients.

Related issues: #21802 and #32388, both closed automatically for inactivity rather than fixed.

Plugins

None

OpenCode version

dev (1.18.30)

Steps to reproduce
  1. Start opencode acp and connect an ACP client that implements requestPermission.
  2. Create a root session and prompt it to use the Task tool to delegate reading a file outside the session working directory.
  3. Observe OpenCode emit permission.asked for the child session.
  4. Observe that the ACP client requestPermission callback is never invoked and the Task remains running.
Expected behavior

ACP should map the child session to its registered root ACP session and forward the permission request using that root session ID. The selected response must still be relayed to the original child session.

Actual behavior

The child session is absent from the ACP session store, so the permission handler returns without forwarding or replying. The subagent remains blocked indefinitely.

Operating System

macOS

Terminal

ACP stdio client

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.