GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `opencode agent list` does not load the agents from plugins · Issue #14036 · anomalyco/opencode

opencode agent list does not load the agents from plugins #14036

New issue
Copy link
New issue
Copy link
Closed
Closed
opencode agent list does not load the agents from plugins#14036
Copy link
Assignees
rekram1-node

Description

@kvokka
kvokka
opened on Feb 17, 2026
Issue body actions

Description

The agents from the plugins are not loaded, while the agents from the plugin are present in TUI/WEB

TL;DR

The issue is well illustrated at RunMaestro/Maestro#284 (comment)

Plugins

[email protected]

OpenCode version

1.2.6

Steps to reproduce

❯ opencode agent list | grep primary
build (primary)
compaction (primary)
plan (primary)
summary (primary)
title (primary)

Screenshot and/or share link

No response

Operating System

ubuntu 24.04

Terminal

iTerm

Reacted by Neo

Activity

  1. kvokka
    added
    bugSomething isn't working
    on Feb 17, 2026
  2. github-actions
    assigned
    rekram1-node
    on Feb 17, 2026
  3. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 17, 2026
  4. code-yeongyu commented on Apr 13, 2026

    @code-yeongyu
    code-yeongyu
    on Apr 13, 2026
    Contributor
    More actions

    Additional Technical Detail

    After deeper analysis, I've identified the exact root cause:

    File: packages/opencode/src/agent/agent.ts lines 401-406

    export const defaultLayer = layer.pipe(
      Layer.provide(Provider.defaultLayer),
      Layer.provide(Auth.defaultLayer),
      Layer.provide(Config.defaultLayer),
      Layer.provide(Skill.defaultLayer),
    )

    Problem: Agent.defaultLayer does NOT include Plugin.layer as a dependency.

    When Agent.list() is called, it initializes state via config.get() BEFORE plugins have loaded. This means the plugin's config hook never has a chance to inject agents.

    Contrast with Provider module (provider.ts lines 1077-1080):

    // load plugins first so config() hook runs before reading cfg.provider
    const plugins = yield* plugin.list()
    // now read config providers - includes any modifications from plugin config() hook

    The Provider module correctly ensures plugins are loaded first. The Agent module should follow the same pattern.

    Suggested Fix:

    export const defaultLayer = layer.pipe(
      Layer.provide(Plugin.layer),  // ADD THIS
      Layer.provide(Provider.defaultLayer),
      Layer.provide(Auth.defaultLayer),
      Layer.provide(Config.defaultLayer),
      Layer.provide(Skill.defaultLayer),
    )

    Or alternatively, inside Agent.state, call plugin.list() before reading config, similar to how Provider.state does it.

  5. johnnyWangJingJing commented on Apr 17, 2026

    @johnnyWangJingJing
    johnnyWangJingJing
    on Apr 17, 2026
    More actions

    更多技术细节

    经过深入分析,我已经找到了确切的根本原因:

    文件:packages/opencode/src/agent/agent.ts第 401-406 行

    export const defaultLayer = layer.pipe(
    Layer.provide(Provider.defaultLayer),
    Layer.provide(Auth.defaultLayer),
    Layer.provide(Config.defaultLayer),
    Layer.provide(Skill.defaultLayer),
    )
    问题:Agent.defaultLayer未将其Plugin.layer作为依赖项包含。

    调用此函数时,它会在插件加载之前Agent.list()初始化状态。这意味着插件的钩子函数根本没有机会注入代理。config.get()``config

    与提供者模块(provider.ts第 1077-1080 行)对比:

    // load plugins first so config() hook runs before reading cfg.provider
    const plugins = yield* plugin.list()
    // now read config providers - includes any modifications from plugin config() hook
    Provider 模块确保插件优先加载。Agent 模块也应遵循相同的模式。

    建议的解决方法:

    export const defaultLayer = layer.pipe(
    Layer.provide(Plugin.layer), // ADD THIS
    Layer.provide(Provider.defaultLayer),
    Layer.provide(Auth.defaultLayer),
    Layer.provide(Config.defaultLayer),
    Layer.provide(Skill.defaultLayer),
    )
    或者,也可以在内部Agent.state,在读取配置之前调用plugin.list(),类似于它是如何Provider.state做的。
    ----------------------------------->
    Excuse me, sir/madam. Could you please tell me how to fix the bugs and modify the code? Is it done manually? Was it accomplished through AI tools?

  6. kvokka commented on Apr 28, 2026

    @kvokka
    kvokka
    on Apr 28, 2026
    Author
    More actions

    @rekram1-node The issue is still in place, and it blocks agent selection in the ACP connection of opencode with other agents like Maestro or OpenCLAW. I just can not pick the agent from the plugin. Also, this makes the global --pure redundant.

    If you don't mind, I can take a look at this one for the proper solution.

    Asking before writing any code to avoid a waste of your or my time

  7. thdxr
    removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  8. rekram1-node
    closed this as completedon May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.