anomalyco / anomalyco/opencode
App bootstrap fetches the whole models.dev catalog from /provider on every start, once per project
@Brendonovich is already working on this.
Since Sep 6, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
GET /provider always builds the full models.dev catalog. Measured against the HTTP API test
harness on this repo's dev, one call is 4,168,456 bytes and ~1.5 s, while the connected
providers in the same instance amount to 4,468 bytes — the catalog is 99.9% of the response.
The app bootstrap asks for that response even though it does not need the catalog yet:
bootstrapGlobalfetchesloadProvidersQuery(scope, null, ...)once
(packages/app/src/context/global-sync/bootstrap.ts),bootstrapDirectoryfetches it again for every project directory,- and
loadProvidersQuerycarries nostaleTime, so every consumer that mounts before the
bootstrap has written its result refetches the same payload.
Only the model picker needs the catalog. Everything else on the startup path — rendering the
currently selected model, the composer controls — needs the connected providers alone. On a slow
or unstable connection the catalog is what the startup waits for.
Related, but different: #44180 makes building the same response cheaper on the server
(memoization); this is about not asking for it during startup at all. #35897 asks for a cap or
pagination on the same endpoint, which is another way to cut the same payload.
Plugins
None
OpenCode version
dev (ea2d59d7ca)
Steps to reproduce
- Start the app with several projects open.
- Watch
GET /providerin the server log or a proxy. - Every bootstrap — global plus one per project directory — transfers the full catalog.
Payload sizes can be reproduced without the app:
GET /provider -> 4,168,456 bytes
GET /provider?connected=true -> 4,468 bytes (with the linked PR applied)
Screenshot and/or share link
N/A
Operating System
Windows 11 (26200)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.