Repository navigation
fix(app): pass --min-cost 0 so Models shows sub-cent and unpriced rows - #1474
Conversation
…priced rows The CLI's models command defaults minCost to $0.01, and the desktop bridge passed no override, so every row below a cent was silently dropped - which by construction excluded every unpriced row too, since cost 0 and savings 0 can never pass a >= 0.01 predicate. The getagentseal#1443 unpriced dimming and add-alias affordances were unreachable in the shipped app. codeburn:getModels now passes --min-cost 0 (equivalent to no filter: both columns are non-negative sums), and the demo harness argv mirror gets the same flag so browser demos match the app. On this machine's real lifetime corpus the table goes 43 -> 53 rows, recovering 10 sub-cent/unpriced rows and 2,160 calls; verified before/after in both themes over CDP against the real app with the report-snapshot memo wiped both sides. A row priced between $0.00 and $0.01 shows as $0.00 without dimming - it is priced, just below the display floor.
|
Reviewed on my own corpus. Confirmed, and the reasoning about No falsy-zero problem on the CLI side. In the running app, Models, all providers, Life, same window and protocol on both sides: 41 rows before, 62 after, matching the CLI exactly. Before shows 0 dimmed rows and 0 add-alias buttons, which is #1443's treatment being unreachable in the shipped app; after shows 20 dimmed rows with an em dash for cost and saved, and 20 add-alias buttons, with observed calls and tokens still rendering. The recovered rows sort last, so the screenshots are scrolled to the tail where the difference actually is. On the numbers rule: the Models table does not sum to the Overview headline for Life ($22,754 and 171k calls against $38,444 and 278,530 calls). That gap is the known live-parse shortfall, it is present identically on the main build, and this PR narrows it by 2,173 calls rather than causing it. Scope is as described. app
|




Fixes #1465.
codeburn:getModelsnow passes--min-cost 0, so the desktop Models table stops silently dropping every row below a cent — which by construction also excluded every unpriced row (a0 >= 0.01predicate), leaving #1443's dimming and add-alias affordances unreachable in the shipped app. The demo-harness argv mirror (app/demo-bridge.mjs) gets the same flag so browser demos match.Why
--min-cost 0and not--unpriced--unpricedfilters to ONLY unpriced rows; the table wants the whole set with unpriced rows included. With--min-cost 0the predicate (costUSD >= 0 || savingsUSD >= 0) is a no-op — both columns are non-negative sums — so this is exactly "no filter".opts.unpricedbehaviour, sorting, and--top(never passed) are untouched.--min-costis declared in serve's flag allowlist (src/serve.ts), so the resident-serve path flows identically, and the in-flight coalescing key includes the full argv.Row-count sanity on a large corpus (as requested)
Real machine, lifetime period, all providers — CLI:
models --format jsondefault = 43 rows;--min-cost 0= 53 rows (+10 sub-cent/unpriced rows, the exact class #1465 names). No cap is needed: the table has no--topand 53 rows render fine.Before / after, both themes (as requested)
Captured over CDP against the real Electron app with the real CLI and real corpus, same protocol on both sides (report-snapshot memo wiped, Life period, Models section):
One display note: a row priced strictly between $0.00 and $0.01 renders as "$0.00" without dimming — it is genuinely priced, just below formatUsd's 2-decimal floor. The dim/
—/add-alias treatment keys offcostUSD === 0 && savingsUSD === 0, which now actually fires for unpriced rows.Tests
getModelsargv expectations inapp/electron/main.test.tsupdated; full app suite green (72 files, 1112 passed).byTaskrows use the same unpriced predicate and already render observed usage for unpriced models (ModelTaskRow), so--by-taskneeds no renderer change.