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
Long-running server keeps per-directory provider models stale after catalog refresh #36284
A long-running opencode serve process keeps provider/model state cached per directory after the models.dev catalog refreshes. Different directories served by the same process can therefore return different model catalogs.
Observed on one server process:
Server started July 8.
~/.cache/opencode/models.json updated July 10 and contains openai/gpt-5.6-sol.
A directory initialized before the update returns 13 OpenAI models and no GPT-5.6 models.
A directory initialized after the update returns 25 OpenAI models, including gpt-5.6-sol-fast.
Repeating GET /provider does not refresh the stale directory.
Restarting opencode serve fixes it.
Expected: directory-scoped provider catalogs eventually reflect refreshed models.dev data without restarting the server or manually disposing each instance.
Suspected cause: provider state created through InstanceState.make() captures modelsDevSvc.get() during directory initialization. The /provider handler merges current ModelsDev entries with connected providers using Object.assign(...); the stale connected provider entry replaces the fresh catalog entry, including its models map.
Possible fix: invalidate/rebuild initialized provider states on ModelsDev.Event.Refreshed, or merge fresh catalog models into connected provider metadata during provider-list reads.
Related but distinct: #36117 covers incomplete snapshots during cold startup. This report concerns a settled catalog remaining stale indefinitely after startup.
Plugins
None
OpenCode version
1.17.13
Steps to reproduce
No response
Screenshot and/or share link
No screenshot. Reproduced directly against the HTTP API.
Activity
github-actions commentedon Sep 9, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.