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
I ran into the same problem and did some analyzation. It seems like the discovered models are never written back to the config object for the desktop app since it is not designed for it.
In plugin/index.ts — the config() hook on the plugin is called like this:
for (const hook of hooks) {
yield* Effect.tryPromise({
try: () => Promise.resolve((hook as any).config?.(cfg)), // <-- cfg is a local snapshot!
...
})
}
The cfg passed to hook.config(cfg) is a local copy obtained earlier in the same InstanceState.make callback. In provider/provider.ts, the Provider service does its own separate config.get() call:
const cfg = yield* config.get()
Thanks for the detailed analysis and reporting! You are absolutely right.
In the Desktop version of OpenCode, there is a known limitation/bug where mutations made by plugins inside the config hook are performed on a local snapshot of the configuration and are not properly propagated or written back to the core UI. Because of this, dynamically discovered models do not appear in the Desktop model picker.
This is an issue in the OpenCode core/desktop app hook lifecycle (which is why the CLI version works perfectly). Our plugin is fully compliant with the OpenCode specification.
We recommend tracking this upstream on the OpenCode repository. Once they fix the propagation of config mutations in the desktop runtime, the model picker will automatically start working there as well. If we discover any plugin-side workarounds in the future, we will certainly update the plugin to support it!
Update: this is now supported in opencode-plugin-litellm v1.4.0.
The original behavior was caused by a runtime difference:
OpenCode 1 uses the legacy config hook.
OpenCode 2/Desktop uses the provider registry API, so the legacy hook was not enough for the Desktop model picker.
PR #32 adds a dual-runtime plugin entrypoint. On OpenCode 2 it registers LiteLLM-discovered models through ctx.provider.transform, while preserving the existing OpenCode 1 behavior. It also supplies the model metadata needed for Desktop visibility and keeps the existing discovery, caching, authentication, filtering, and capability handling.
Please upgrade to opencode-plugin-litellm@1.4.0 and use the OpenCode 2 plugins / providers configuration format. The implementation is here: #32
If models still do not appear after upgrading, please share the OpenCode/plugin version and the plugin log output so we can investigate a separate provider or picker issue.
Activity
exx-trost commentedon May 29, 2026
I ran into the same problem and did some analyzation. It seems like the discovered models are never written back to the config object for the desktop app since it is not designed for it.
In plugin/index.ts — the config() hook on the plugin is called like this:
The cfg passed to hook.config(cfg) is a local copy obtained earlier in the same InstanceState.make callback. In provider/provider.ts, the Provider service does its own separate config.get() call:
const cfg = yield* config.get()
might be actually related to: anomalyco/opencode#25630
yuseferi commentedon Jul 24, 2026
Thanks for the detailed analysis and reporting! You are absolutely right.
In the Desktop version of OpenCode, there is a known limitation/bug where mutations made by plugins inside the
confighook are performed on a local snapshot of the configuration and are not properly propagated or written back to the core UI. Because of this, dynamically discovered models do not appear in the Desktop model picker.This is an issue in the OpenCode core/desktop app hook lifecycle (which is why the CLI version works perfectly). Our plugin is fully compliant with the OpenCode specification.
We recommend tracking this upstream on the OpenCode repository. Once they fix the propagation of config mutations in the desktop runtime, the model picker will automatically start working there as well. If we discover any plugin-side workarounds in the future, we will certainly update the plugin to support it!
yuseferi commentedon Sep 29, 2026
Update: this is now supported in
opencode-plugin-litellmv1.4.0.The original behavior was caused by a runtime difference:
confighook.PR #32 adds a dual-runtime plugin entrypoint. On OpenCode 2 it registers LiteLLM-discovered models through
ctx.provider.transform, while preserving the existing OpenCode 1 behavior. It also supplies the model metadata needed for Desktop visibility and keeps the existing discovery, caching, authentication, filtering, and capability handling.Please upgrade to
opencode-plugin-litellm@1.4.0and use the OpenCode 2plugins/providersconfiguration format. The implementation is here:#32
If models still do not appear after upgrading, please share the OpenCode/plugin version and the plugin log output so we can investigate a separate provider or picker issue.