Repository navigation
Description
Summary
In OpenCode v2, the first prompt after an idle period can fail with ModelUnavailableError for a valid Console model such as opencode/gpt-5.5. The failure appears to be a local catalog readiness race: Console has the model, but the local v2 catalog is read before the OpenCode provider refresh has finished.
Environment
- opencode version: Unavailable: reported from a user's local v2 box; exact version not captured in the source report
- OS: Unavailable: reporter OS not captured
- Terminal: Unavailable: reporter terminal not captured
- Shell: Unavailable: reporter shell not captured
- Install/channel: OpenCode v2 local session, exact channel unavailable
- Active plugins: Unavailable: reporter plugin/config state not captured
Reproduction
- Use OpenCode v2 with the OpenCode Console provider and a valid model that Console returns for the credential, e.g.
opencode/gpt-5.5. - Leave the session/location idle long enough for location services to cold boot on the next turn.
- Send a prompt immediately after the idle period.
- Observe the first turn resolving the model before the async OpenCode provider refresh has populated the local catalog.
Expected Behavior
The first prompt after idle should wait for the provider/catalog refresh needed to validate the configured model, then continue normally when Console says the model is available.
Actual Behavior
The prompt fails with ModelUnavailableError; from the user's perspective, they send a prompt and nothing happens besides an error.
The observed failure mode is not Console saying the model is unavailable. Console returns gpt-5.5 for the anomaly credential, but the local v2 catalog snapshot does not yet include providerID=opencode, modelID=gpt-5.5 when model resolution runs.
Additional Context
Likely race identified from source inspection:
packages/core/src/session/runner/model.ts:SessionRunnerModel.resolvecheckscatalog.model.available()for the provider/model pair and throwsModelUnavailableErrorwhen absent.packages/core/src/location-services.ts: location services are cached for 60 minutes; after idle, the next message cold-boots location services.packages/core/src/plugin/internal.ts: internal plugin boot runs in a fork and is not awaited.packages/core/src/plugin/provider/opencode.ts: initial OpenCode Console provider refresh is started in a fork and is not awaited.- Result: the session runner can read the catalog before the async OpenCode provider refresh has fetched/reloaded Console models.
Reported from internal Discord discussion: https://discord.com/channels/1391832426048651334/1447692703549755466/1522079701697429645
Activity
kitlangton commentedon Jul 4, 2026
Confirmed this race remains on the current V2 branch. #35267 implements the readiness barrier and regression coverage, but is still open with failing Linux and Windows unit CI. Keeping this issue open until that PR lands successfully.
thdxr commentedon Jul 9, 2026
Closing this tracker after the recent V2 server lifecycle, restart continuity, reconnect hydration, and synchronization work. This area has changed substantially, and we want to track any remaining or newly reproducible behavior as a fresh, focused issue against the current implementation.