fix(models): cache catalog for offline startup
Persist the last valid Command Code model catalog and use it when live model discovery fails. Keep first-time offline startup non-fatal, surface clear warnings, and cover cached model selection with unit and pi integration regression tests.
This commit is contained in:
@@ -134,7 +134,9 @@ On startup, the provider fetches:
|
||||
https://api.commandcode.ai/provider/v1/models
|
||||
```
|
||||
|
||||
For tests or local mocks, override it with `COMMANDCODE_MODELS_URL`.
|
||||
The last successfully fetched catalog is cached at `~/.commandcode/pi-models.json`. If model discovery is temporarily unavailable, the provider uses this cached catalog so previously discovered Command Code models remain selectable. On a first offline start without a cache, pi still loads, but Command Code models remain unavailable until the connection is restored and `/reload` succeeds.
|
||||
|
||||
For tests or local mocks, override the endpoint with `COMMANDCODE_MODELS_URL` and the cache location with `COMMANDCODE_MODELS_CACHE`.
|
||||
|
||||
## Pricing
|
||||
|
||||
|
||||
Reference in New Issue
Block a user