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: set_config_option rejects a configured model selected right after session/new #52472
Follow-up to #49630 / #50236, closed as fixed by #52286. On 2.0.21, which includes #52286, an ACP client that selects a model from opencode.json right after session/new still gets -32602 Invalid params: model not found. Sent two seconds later, the same request succeeds.
model.list answers before the location's plugins have registered config providers. So the catalog session/new loads lacks them, and the single reload in withReload before rejecting happens straight away, still too early. The config_option_update arrives a few hundred ms later. Editors cope; clients that pick a model during setup don't.
A fix that keeps catalog reads non-blocking: after that reload, keep following catalog refreshes until the value appears, plugin.updated marks activation done, or 5 s pass. I have it working with wire tests against v2, and can rebase it on #52471 if that helps.
In an empty directory, an opencode.json with a custom provider: "provider": { "myprovider": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "http://127.0.0.1:9/v1", "apiKey": "x" }, "models": { "my-model": {} } } }
Run opencode acp there and send initialize, then session/new.
Immediately send session/set_config_option with configId: "model", value: "myprovider/my-model".
Expected: the model is selected. Actual: -32602 model not found: myprovider/my-model.
This issue might be a duplicate of existing issues. Please check:
#50236: ACP session/new omitted configured providers from its catalog, causing model availability problems. This report appears to describe a remaining timing race after the fix.
#49630: Custom-provider models were missing from the ACP catalog and failed with model not found.
Fixed by #53358 on v2. The first session/new now waits until the location's plugins have registered their providers, so a model from opencode.json can be selected right after session/new without -32602. It ships in the next release.
Activity
github-actions commentedon Oct 1, 2026
This issue might be a duplicate of existing issues. Please check:
session/newomitted configured providers from its catalog, causing model availability problems. This report appears to describe a remaining timing race after the fix.model not found.feat(opencode): support OpenCode 2 (#6)
nexxeln commentedon Oct 6, 2026
Fixed by #53358 on v2. The first session/new now waits until the location's plugins have registered their providers, so a model from opencode.json can be selected right after session/new without -32602. It ships in the next release.