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. |
||
|---|---|---|
| .. | ||
| fixtures/security | ||
| providers | ||
| security | ||
| bash-commands.test.ts | ||
| classifier.test.ts | ||
| cli-date.test.ts | ||
| cli-export-date-range.test.ts | ||
| cli-json-daily.test.ts | ||
| cli-plan.test.ts | ||
| compare-stats.test.ts | ||
| currency-rounding.test.ts | ||
| daily-cache.test.ts | ||
| dashboard.test.ts | ||
| date-range-filter.test.ts | ||
| day-aggregator.test.ts | ||
| export.test.ts | ||
| fs-utils.test.ts | ||
| mcp-coverage.test.ts | ||
| menubar-json.test.ts | ||
| minimax.test.ts | ||
| model-efficiency.test.ts | ||
| models-hoist.test.ts | ||
| models-report.test.ts | ||
| models.test.ts | ||
| optimize-fs.test.ts | ||
| optimize.test.ts | ||
| parser-claude-cwd.test.ts | ||
| parser-filter.test.ts | ||
| parser-mcp-inventory.test.ts | ||
| plan-usage.test.ts | ||
| plans.test.ts | ||
| provider-registry.test.ts | ||