You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opencode agent list does not load the agents from plugins #14036
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.providerconstplugins=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.
// 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?
@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
Activity
code-yeongyu commentedon Apr 13, 2026
Additional Technical Detail
After deeper analysis, I've identified the exact root cause:
File:
packages/opencode/src/agent/agent.tslines 401-406Problem:
Agent.defaultLayerdoes NOT includePlugin.layeras a dependency.When
Agent.list()is called, it initializes state viaconfig.get()BEFORE plugins have loaded. This means the plugin'sconfighook never has a chance to inject agents.Contrast with Provider module (
provider.tslines 1077-1080):The Provider module correctly ensures plugins are loaded first. The Agent module should follow the same pattern.
Suggested Fix:
Or alternatively, inside
Agent.state, callplugin.list()before reading config, similar to howProvider.statedoes it.johnnyWangJingJing commentedon Apr 17, 2026
kvokka commentedon Apr 28, 2026
@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
--pureredundant.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