Skip to content

[ACP v2] Plugin-registered agents missing from the session mode list #51819

Closed

Description

@mxalbert1996

Description

Summary

Agents registered by plugins never show up as selectable modes in ACP sessions. The mode list is built once per directory on the first session/new, and that read happens before plugin setup has finished, so the list is latched with only the built-in agents and never refreshes.

Cause

loadCatalog in packages/cli/src/acp/service.ts polls model.list / agent.list in a loop but returns on the first iteration that finds a default model and a primary agent. The built-in build agent and static-catalog models satisfy both conditions immediately, so the catalog is complete before any external plugin has registered its transforms. Plugin setups are started in the background by the plugin supervisor and finish after location services are already serving requests, so the first agent.list read can't see them.

The v1 ACP implementation doesn't have this problem — its directory loader awaits plugin initialization before reading agents.

Plugins

oh-my-opencode-slim / custom plugin

OpenCode version

2.0.18

Steps to reproduce

  1. Configure a plugin that registers an agent through ctx.agent.transform and marks it as a primary agent.
  2. Start opencode acp, run the initialize handshake, then session/new.
  3. Inspect the configOptions mode list in the session/new response (or check the agent picker of an ACP client such as Zed).

Result

Only the built-in agents (build, plan) are listed. Even creating the session long after the plugin has finished loading doesn't help: the catalog is cached per directory for the lifetime of the process, and session/set_mode only accepts ids from that cached list.

Screenshot and/or share link

N/A

Operating System

macOS 26.6.2

Terminal

Ghostty

Activity

  1. github-actions commented on Sep 28, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. nexxeln commented on Sep 30, 2026

    @nexxeln
    Contributor

    Fixed by #52286 (merged in 1844c11): ACP no longer pins agent/model from an early catalog snapshot on session/new, and it refreshes the catalog (pushing config_option_update / available_commands_update) when plugins finish loading config agents, providers, and commands. It also reloads the catalog before rejecting an unknown model or mode in set_config_option / set_mode. Please reopen if you still see this on a release that includes the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions