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:
2026-07-08 23:51:23 +02:00
co-authored by Claude Opus 4.8
parent 2f3dfe2305
commit 9301d387fa
16 changed files with 428 additions and 19 deletions
Generated
+1
View File
@@ -679,6 +679,7 @@ dependencies = [
"thiserror 2.0.18",
"tokio",
"tokio-util",
"tracing",
]
[[package]]