mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-05-17 03:56:45 +00:00
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. |
||
|---|---|---|
| .. | ||
| data | ||
| providers | ||
| bash-utils.ts | ||
| classifier.ts | ||
| cli-date.ts | ||
| cli.ts | ||
| codex-cache.ts | ||
| compare-stats.ts | ||
| compare.tsx | ||
| config.ts | ||
| context-budget.ts | ||
| currency.ts | ||
| cursor-cache.ts | ||
| daily-cache.ts | ||
| dashboard.tsx | ||
| day-aggregator.ts | ||
| export.ts | ||
| format.ts | ||
| fs-utils.ts | ||
| ink-win.ts | ||
| menubar-installer.ts | ||
| menubar-json.ts | ||
| model-efficiency.ts | ||
| models-report.ts | ||
| models.ts | ||
| optimize.ts | ||
| parser.ts | ||
| plan-usage.ts | ||
| plans.ts | ||
| sqlite.ts | ||
| types.ts | ||
| yield.ts | ||