codeburn/src
Resham Joshi cdf7169a89
Cursor model aliases: cover every variant so non-Auto sessions price (#159) (#290)
Cursor emits model names in a `claude-<dot-version>-<tier>` shape
(`claude-4.6-sonnet`, `claude-4.5-opus`, `claude-4.5-opus-high-thinking`,
etc.) plus its own `composer-1` house model. None of these match
the canonical LiteLLM pricing keys (`claude-sonnet-4-6`,
`claude-opus-4-5`).

The alias map in `src/models.ts` filled some of these in v0.9.4
but missed:

- plain no-suffix forms: `claude-4.5-opus`, `claude-4.5-sonnet`,
  `claude-4.6-opus`
- haiku tier: `claude-4.5-haiku`, `claude-4.6-haiku`
- forward-looking: `claude-4.7-opus`
- Cursor's house model: `composer-1`

The dashboard rendered $0 for sessions that used any unaliased
model — visible in the screenshots posted in #159 even after the
v0.9.4 fix that added the `-thinking` variants.

This PR fills the gaps and adds 16 regression tests under
`Cursor model variants resolve to pricing` that assert every
model name in `src/providers/cursor.ts:modelDisplayNames` plus
the additional plain forms resolves to a non-null pricing entry
with `inputCostPerToken > 0` and `outputCostPerToken > 0`. So a
future LiteLLM snapshot bump or a typo in the alias map will fail
the test before users see $0.

Direct hits in the snapshot (no alias needed): `gpt-5`, `gpt-5.2`,
`grok-code-fast-1`, `gemini-3-pro` (already aliased). These are
covered in the test suite as well so a snapshot that drops them
would also be caught.

Tests: 45 files, 617 passing locally (16 new). Closes #159.
2026-05-10 03:27:44 -07:00
..
data Label optimize suggestions by destination (#281) 2026-05-08 23:30:53 -07:00
providers Support CLAUDE_CONFIG_DIRS for scanning multiple Claude data dirs (#208) (#288) 2026-05-09 22:04:45 -07:00
bash-utils.ts Strip ANSI escapes from bash commands across all providers 2026-05-02 20:59:24 -07:00
classifier.ts Classifier: feature verb wins over debug keyword (part of #196) (#289) 2026-05-09 22:48:11 -07:00
cli-date.ts Reject invalid --format and --period values instead of silently falling back (#258) 2026-05-06 23:03:41 -07:00
cli.ts Expose per-day one-shot data in daily JSON output (#279) (#280) 2026-05-09 21:01:05 -07:00
codex-cache.ts Add per-file result cache for Codex provider 2026-04-30 16:43:41 -07:00
compare-stats.ts feat(compare): model comparison with planning rate fix 2026-04-19 08:34:49 -07:00
compare.tsx Quiet routine pricing warnings + menubar recovery from stuck-loading (#266) 2026-05-08 20:33:48 -07:00
config.ts Validator hardenings on the bug-hunt batch (#254) 2026-05-06 19:50:40 -07:00
context-budget.ts fix(context-budget): use bounded readSessionFile helper 2026-04-17 08:32:19 +02:00
currency.ts Menubar and CLI hardening from multi-agent audit (#257) 2026-05-06 22:15:11 -07:00
cursor-cache.ts Validator hardenings on the bug-hunt batch (#254) 2026-05-06 19:50:40 -07:00
daily-cache.ts Validator hardenings on the bug-hunt batch (#254) 2026-05-06 19:50:40 -07:00
dashboard.tsx Label optimize suggestions by destination (#281) 2026-05-08 23:30:53 -07:00
day-aggregator.ts fix: use local timezone for daily date bucketing instead of UTC 2026-04-19 03:18:38 -07:00
export.ts Menubar and CLI hardening from multi-agent audit (#257) 2026-05-06 22:15:11 -07:00
format.ts Validator hardenings on the bug-hunt batch (#254) 2026-05-06 19:50:40 -07:00
fs-utils.ts Stream-parse Codex session files to handle 250+ MB rollouts 2026-05-04 02:15:04 +03:00
ink-win.ts Fix dashboard hang and ExperimentalWarning on Windows 2026-05-02 11:54:58 -07:00
menubar-installer.ts Wait for old menubar process to exit before launching new one 2026-05-08 13:08:34 -07:00
menubar-json.ts feat(mac): native Swift menubar app + one-command install 2026-04-17 16:55:56 -07:00
model-efficiency.ts feat(report): add per-model efficiency metrics 2026-05-05 23:36:59 -07:00
models-report.ts Add codeburn models per-model + per-task breakdown command (#287) 2026-05-09 20:45:21 -07:00
models.ts Cursor model aliases: cover every variant so non-Auto sessions price (#159) (#290) 2026-05-10 03:27:44 -07:00
optimize.ts Label optimize suggestions by destination (#281) 2026-05-08 23:30:53 -07:00
parser.ts Support CLAUDE_CONFIG_DIRS for scanning multiple Claude data dirs (#208) (#288) 2026-05-09 22:04:45 -07:00
plan-usage.ts fix(plan): resolve type errors in plan summary and isActivePlan guard 2026-04-21 04:20:55 -07:00
plans.ts Add claude-max-5x preset for $100/month tier 2026-04-24 15:47:59 +02:00
sqlite.ts Refuse to load node:sqlite on known-buggy Node 22.x patch versions (#265) 2026-05-07 09:48:57 -07:00
types.ts feat(optimize): MCP tool coverage detector with cache-aware costing 2026-05-05 04:13:04 +03:00
yield.ts Validator hardenings on the bug-hunt batch (#254) 2026-05-06 19:50:40 -07:00