harness-providers: models.dev catalog + cost display wiring (M3)
- modelsdev.rs: ModelCatalog parses models.dev api.json → ModelInfo keyed by (provider, model); 24h file cache at ~/.cache/ai-harness/models.json with a baked assets/models-snapshot.json fallback so cost/limits work offline. load_cached_or_baked (no network) + refresh/refresh_default_cache (background). - App: loads the catalog at init (cached-or-baked, never blocks), warms the cache in a background task, and passes the session model's pricing into RunConfig.cost so session cost accrues for real. - TUI: AppState tracks session_cost/session_tokens from Session events; status bar shows "<tokens> · $<cost>". Snapshots updated. - 7 modelsdev tests (parse, defaults, unknown-model, baked snapshot, cache TTL, cached-vs-baked load). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@ tokio = { workspace = true }
|
||||
tokio-util = { workspace = true }
|
||||
dirs = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = { workspace = true }
|
||||
|
||||
Reference in New Issue
Block a user