Repository navigation
fix(models): group Trend rows and the models command by the same display name - #1241
Merged
Merged
Conversation
This was referenced Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1239
Problem
The desktop Trend/Spend view built its per-day model rows straight from the raw provider/model string (
day.models[call.model]inday-aggregator.ts), whilecodeburn modelsalready merges by alias-resolved canonical id. Same day, same data, two different ideas of what counts as "one model".Fix
history.daily[].topModels(the payload backing the Trend/Spend charts) now merges by the same normalized display namecodeburn modelsalready uses (getShortModelName), via a newmergeDayModelsByDisplayNamestep inusage-aggregator.ts. Rows that fold two or more raw ids together carry a new optionalrawModelsfield so a cached vs uncached route stays visible.codeburn modelsgets the same field (ModelReportRow.rawModels) so its JSON output shows the collapsed routes too. Both changes are additive to the CLI-app payload contract — no field renamed or removed.The desktop
StackedBarstooltip appends the route list when more than one raw id fed a segment.Before / after (2026-08-26, real data)
Before (issue report):
minimax/MiniMax-M3$6.99 / 23.1M tok, andMiniMaxAI/MiniMax-M3as a separate rowcodeburn models: one row "MiniMax M3", 415 calls, 27.25M tok, $7.36After (this branch,
node dist/cli.js status --format menubar-json --from 2026-08-26 --to 2026-08-26andnode dist/cli.js models --from 2026-08-26 --to 2026-08-26 --format json):history.daily[].topModels): one row,"name": "MiniMax M3","rawModels": ["minimax/MiniMax-M3", "MiniMaxAI/MiniMax-M3"]codeburn models: unchanged single row (415 calls, 27.25M tok, $7.36), now also carrying"rawModels": ["minimax/MiniMax-M3", "MiniMaxAI/MiniMax-M3"]Both surfaces now agree, and the route split is still visible on both.
Test plan
npx vitest run tests/models-report.test.ts tests/usage-aggregator.test.ts(root) — new tests cover the MiniMax merge + rawModelsnpx vitest run(app/) — full app suite green except the 27 pre-existing unrelatedusePolled.test.ts/overviewSnapshot.test.tslocalStorage failuresnpx tsc --noEmitat root and inapp/— cleannpm run buildthen verified against real session data for 2026-08-26 (see before/after above)