perf: cache the CLI catalog with validated startup fallback

Ports #6 with optional-field validation, conversion before cache writes, an upstream-specific cache directory, and startup regression tests.

Co-authored-by: dualface <dualface@gmail.com>
This commit is contained in:
Kashyab Ambarani
2026-09-25 03:41:59 -07:00
co-authored by dualface
parent 5d6090ae46
commit e6b5247cc0
5 changed files with 331 additions and 20 deletions
+2
View File
@@ -69,6 +69,8 @@ Commands:
- `/devin-status` — CLI path, version, auth
- `/devin-refresh` — reload `devin models list --format json`
The model catalog is cached for six hours in `$XDG_CACHE_HOME/pi-devin/models.json` (or `~/.cache/pi-devin/models.json`). A fresh cache avoids the CLI call at startup; an older cache remains available while it refreshes in the background. Set `PI_OFFLINE=1` to skip automatic catalog refreshes. `/devin-refresh` still requests a refresh explicitly.
## What this is / is not
| This package | Not this package |