M11: model catalog, context window, subscription usage #96

Merged
hermes merged 1 commits from models into main 2026-10-01 11:53:34 +00:00
Collaborator

Models, context window, usage (M11).

  • Model catalog (hx_ai::models): live list per logged-in provider (/v1/models for Claude, Codex backend /models), cached 24h in ~/.hx/models-<provider>.json, fallback to a built-in current list (Claude Opus/Sonnet 5.5, Fable 5.1, Haiku 4.5; GPT-5.6 Sol/Terra/Luna). Default model: latest Sonnet (Claude) / top-listed (Codex). Default provider: configured, else first logged in.
  • Only logged-in providers: /model completion and /provider choices exclude providers without credentials (no more gpt models with only Claude connected).
  • Context window: compaction threshold = 90% of the model's window (minus max output) instead of fixed 150k; footer bar uses it; /model reports it; compact_at config still overrides.
  • Usage: new StreamEvent::Quota parsed from anthropic-ratelimit-unified-* and x-codex-* headers. Footer: 5h 42% ↻2h13m · week 13% (+ credits/extra-usage), coloured at 70/90%, replaces the $ estimate. /usage lists windows, % left, reset times, credits, context, session tokens.
  • Pricing table updated for 5.x / GPT-5.6 models.

Verified: tests/all.sh green (78 unit tests, all e2e; tui smoke checks default model, 900k window, quota footer, /usage, live catalog model with 2M window, cache file, only claude offered by /provider).

closes #93, closes #94, closes #95

Models, context window, usage (M11). - **Model catalog** (`hx_ai::models`): live list per logged-in provider (`/v1/models` for Claude, Codex backend `/models`), cached 24h in `~/.hx/models-<provider>.json`, fallback to a built-in current list (Claude Opus/Sonnet 5.5, Fable 5.1, Haiku 4.5; GPT-5.6 Sol/Terra/Luna). Default model: latest Sonnet (Claude) / top-listed (Codex). Default provider: configured, else first logged in. - **Only logged-in providers**: `/model` completion and `/provider` choices exclude providers without credentials (no more gpt models with only Claude connected). - **Context window**: compaction threshold = 90% of the model's window (minus max output) instead of fixed 150k; footer bar uses it; `/model` reports it; `compact_at` config still overrides. - **Usage**: new `StreamEvent::Quota` parsed from `anthropic-ratelimit-unified-*` and `x-codex-*` headers. Footer: `5h 42% ↻2h13m · week 13%` (+ credits/extra-usage), coloured at 70/90%, replaces the $ estimate. `/usage` lists windows, % left, reset times, credits, context, session tokens. - Pricing table updated for 5.x / GPT-5.6 models. Verified: `tests/all.sh` green (78 unit tests, all e2e; tui smoke checks default model, 900k window, quota footer, /usage, live catalog model with 2M window, cache file, only claude offered by /provider). closes #93, closes #94, closes #95
hermes added 1 commit 2026-10-01 11:53:33 +00:00
M11: provider model catalog, per-model context window, subscription usage in footer + /usage
ci / check (pull_request) Canceled after 0s
ci / check (push) Canceled after 0s
6533dde4ca
hermes merged commit 658ada46f7 into main 2026-10-01 11:53:34 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johannes/hx#96