fix(models): treat subscription SKUs as honestly $0 - #1050
Conversation
Unpriced warnings were firing on flat-rate product ids and telling users to model-alias them, which invents spend.
Extra High: calculateCost still told users to model-alias an unknown SKU unconditionally. Route that warning through unpricedModelHint so alias and model-flat-rate are both named.
|
Reviewed in depth with real-data runs. The third-state concept and the
Suggested landing order across the trio: #1056 (with its version fix) → this one (rebased per above) → #1053 (re-keyed). |
… built-ins Maintainer review on getagentseal#1050: drop metered codex-auto-review, add kimi-for-coding-highspeed, match Warp's auto id, drop unsourced big-pickle, and give model-flat-rate --remove power over built-ins.
…n-flat-rate # Conflicts: # CHANGELOG.md
ozymandiashh
left a comment
There was a problem hiding this comment.
Code review is otherwise positive: the effective auto-merged code passed 239 targeted tests and typecheck, and the opt-out/flat-rate behavior matched the stated cases. I am not approving or merging this head because it currently conflicts with main in CHANGELOG.md. Please rebase and preserve both changelog entries; I can do the final live merge check on the resolved head.
Resolves conflicts against main after getagentseal#1078/getagentseal#1084/getagentseal#1088/getagentseal#1090/getagentseal#1092/ getagentseal#1053/getagentseal#1056 landed since this branch's last upstream merge. - CHANGELOG.md: kept both entries (this PR's getagentseal#968/getagentseal#1050 note plus main's getagentseal#1079/getagentseal#1088, getagentseal#1082, getagentseal#1075 notes that had moved into the same "### Fixed" slot). - Everything else (src/models.ts, main.ts, usage-aggregator.ts, daily-cache.ts, tests/*) merged cleanly with no conflict markers; git's recursive merge combined getagentseal#1050's flat-rate classifier changes with getagentseal#1056's codex-auto-review -> gpt-5.5 alias without overlap. Verified the codex-auto-review / getagentseal#1056 interaction post-merge: isBuiltInFlatRateModel no longer matches codex-auto-review (dropped per getagentseal#1050), while MODEL_ALIASES still aliases it to gpt-5.5 (getagentseal#1056), so it prices at GPT-5.5 rates rather than $0. Covered by the existing tests/models.test.ts "Codex activity ids (getagentseal#1047)" describe block and the "does not treat a priced sibling as expected-free" case. getFlatRateModelsConfigHash's output is folded into getDailyCacheConfigHash's template literal unconditionally (flatRateModels=<hash>), so the flat-rate section always participates in the daily-cache invalidation hash even when empty -- no DAILY_CACHE_VERSION bump needed for this change.
The merge with main pulled in getagentseal#1056's codex-auto-review -> gpt-5.5 alias, which findUnpricedModels' pre-existing hasBillableRate check now resolves for the raw id, so a synthetic $0 row for it is no longer reported as unpriced (it correctly has a billable rate). Removed it from the expected findUnpricedModels() output in the "skips subscription / flat-rate product SKUs" test; the display-name variant ('Codex Auto Review') is unaffected since getModelCosts does not resolve display names, so it stays in the expected list. The codex-auto-review / getagentseal#1056 pricing interaction itself is already covered by the "Codex activity ids (getagentseal#1047)" describe block.
Problem
The unpriced-models warning from #638 fires on subscription / flat-rate product SKUs whose cost genuinely is $0. The suggested
model-aliasfix maps those ids onto another model's per-token rate and invents spend.The first cut classified the wrong ids: it treated metered
codex-auto-reviewas $0, missedkimi-for-coding-highspeed(the SKU #968 was filed around), and certified a synthetic Warp id (warp) that no provider emits.Closes #968.
Root cause
findUnpricedModels/isExpectedFreeModelonly treated local-looking models,model-savingsmappings, and exact zero-rate user overrides as "expected free". Subscription product SKUs look like missing LiteLLM rows. The built-in classifier then used screenshot strings instead of the ids providers actually write, andmodel-flat-rate --removecould not unsilence a wrong built-in.Change
Third state alongside priced and unpriced: flat-rate / subscription-billed.
auto-genius, Warpauto/warp-auto-*,kimi-for-coding-highspeed,grok-composer-*, plus Warp Auto / Grok Composer display aggregation keys.codex-auto-review(metered; Auto code reviews continue with Auto review disabled and consume main model usage openai/codex#32224; priced by fix(models): price Codex activity ids via the official underlying model #1056) and unsourcedbig-pickle.codeburn model-flat-rate <model>(--list/--remove).--removeopts out of a built-in so a false positive can warn again without a release.unpricedModelHint(): alias only if billed per token; otherwisemodel-flat-rate.warp-auto-*aliases stay priced; those calls remain in the coverage denominator.User impact
Known subscription SKUs drop out of the unpriced warning. Remaining unpriced rows still get an alias path, plus an honest hatch when $0 is correct. A wrong built-in can be opted out with
--remove.Preservation
No new LiteLLM rates. No removal of
warp-auto-*aliases. No parser / billing-provenance rewrite. No Keychain / Buzz / #868 / #916 / #998 work. No second Extra High.Testing
autovs syntheticwarp, kimi-for-coding-highspeed, auto-review unsilenced, built-in opt-out + snapshot + hash) andmodel-flat-rateCLI (user mark round-trip, built-in--remove/ re-add)warp-auto-efficientstaysisExpectedFreeModel=falsebecause it still has a billable alias