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
ACP: first session/new per process omits the built-in opencode provider from configOptions #52729
In a fresh opencode acp process, the firstsession/new returns a configOptions.model list that omits the built-in opencode provider. A secondsession/new in the same process returns the complete list. The same models are present in opencode models from the start.
Observed deterministically across repeated fresh processes:
new #1 -> n=771 opencode=0 current=openrouter/unbiased/pareto-26.10-preview
new #2 -> n=744 opencode=9 current=openrouter/unbiased/pareto-26.10-preview
What is not the cause (tested)
Not a wait/startup-race that another second fixes: sleeping 0/1/2/3/5/8s after initialize and before the first session/new always yields opencode=0.
Not model selection per se: re-setting model to the current value (openrouter/unbiased/pareto-…) returns opencode=0; setting configId: "mode" returns opencode=0.
Forcing the provider works:session/set_config_option(configId="model", value="opencode/…") returns the complete list (9 opencode/*) because resolving a model from that provider loads it.
session/resume as the first call is also incomplete: resuming a session whose saved model is opencode/big-pickle returns currentValue=opencode/big-pickle but only 771 options, 0 opencode/.
Expected
The first session/new (and session/resume) in a process should return the same complete configOptions as later calls and as opencode models.
Actual
The first session snapshot is built before the built-in opencode provider is registered; creating a session then triggers its load, so subsequent sessions include it.
Likely cause
In packages/opencode/src/acp/service.ts, newSession() builds configOptions from loadDirectorySnapshot() → sdk.config.providers({ directory }). On the first request the built-in opencode provider is not yet present in that map (its registration appears to happen as a side effect of session creation/provider resolution). defaultModelFromConfig() therefore can't prefer it either, and falls back to the globally sorted best model. Later sessions see the now-registered provider.
Fixed by #53358 on v2. The ACP catalog now waits for a cold location's plugins to finish loading before its first read, so the first session/new lists the opencode provider models along with the rest. It ships in the next release.
Activity
github-actions commentedon Oct 2, 2026
This issue might be a duplicate of existing issues. Please check:
session/newomitted configured providers/models from its catalog while provider registration was pending.klonuo commentedon Oct 2, 2026
It is same issue, but that obviously didn't fix it and it is closed
nexxeln commentedon Oct 6, 2026
Fixed by #53358 on v2. The ACP catalog now waits for a cold location's plugins to finish loading before its first read, so the first session/new lists the opencode provider models along with the rest. It ships in the next release.