Expose external Agent Client Protocol agents as optional OpenCode subagents.
Use this when you want the orchestrator to delegate to software-connected tools such as Claude Code ACP, Gemini ACP, or another ACP-compatible coding agent.
Each acpAgents entry creates a lightweight wrapper subagent. The wrapper can
only call acp_run, which:
- Starts the configured ACP subprocess over stdio.
- Sends
initialize. - Creates a session with
session/new. - Sends the task with
session/prompt. - Collects
session/updateagent_message_chunktext. - Returns the external agent's final output to OpenCode.
The wrapper is sandboxed from normal local tools such as bash, edit,
task, webfetch, grep, and glob.
Add acpAgents to ~/.config/opencode/oh-my-opencode-slim.jsonc or a
project-local .opencode/oh-my-opencode-slim.jsonc file:
Restart OpenCode after changing config. Then call the generated agent directly:
@claude-research investigate this bug and summarize the likely cause
Or let the orchestrator delegate to it when its routing prompt matches the task.
| Option | Type | Default | Description |
|---|---|---|---|
command |
string | - | ACP executable. Put flags in args, not here. |
args |
string[] | [] |
Arguments for the ACP command. |
env |
object | {} |
Extra environment variables for the subprocess. |
cwd |
string | current session directory | Working directory override. ACP paths should be absolute. |
description |
string | generated | Role text shown to OpenCode and the orchestrator. |
prompt |
string | generated | Full prompt for the wrapper subagent. Usually unnecessary. |
orchestratorPrompt |
string | generated | Exact routing block injected into the orchestrator prompt. |
wrapperModel |
string | fixer default | Cheap OpenCode model used by the wrapper. |
permissionMode |
ask | allow | reject |
ask |
How ACP permission requests are answered. |
timeoutMs |
integer | 300000 |
Timeout for one ACP run. |
permissionvspermissionMode: These are separate concepts.
permission(on normal custom, built-in, and preset agents) provides SDK-enforced, expressive per-tool rules with pattern support, acceptingask/allow/deny. See Agent Permissions.permissionMode(ACP agents only) controls how the plugin answers the external ACP subprocess's permission requests, with simplerask/allow/rejectoptions.
ACP agents may advertise authMethods during initialization and may require
authentication before session/new. The bridge attempts the first advertised
auth method if the agent reports an auth-required error.
Some agents still require manual setup first. For example, run the external agent's login command in your terminal before using the wrapper:
claude /loginUse the command required by your ACP server.
- The plugin asks before launching the configured subprocess.
- The wrapper agent can only call
acp_run. acp_runcan only be called by the matching wrapper agent.- External ACP agents may still run their own tools depending on their own implementation and permission flow.
- Keep secrets in environment variables and pass only the minimum needed via
env.
- Agent not available: restart OpenCode after editing config.
- Unknown ACP agent: check that the
acpAgentskey name matches your@agentname. - Auth required: run the ACP agent's login/auth setup command directly.
- No output: verify the command works as an ACP server in a terminal or ACP client.
{ "acpAgents": { "claude-research": { "command": "claude-code-acp", "args": [], "description": "Claude Code subscription agent for deep research", "wrapperModel": "openai/gpt-5.6-luna", "permissionMode": "ask", "timeoutMs": 300000 }, "gemini-acp": { "command": "gemini", "args": ["--experimental-acp"], "description": "Gemini CLI through ACP" } } }