fix(pricing): key the fast lane per model in a slash-combined row - #32
Merged
Conversation
The published fast-mode table now bills one shared lane for several models by
naming them in a single cell ("Claude Opus 5 / Claude Opus 4.8"). buildFastInput
keyed the map on the raw cell text, so no per-model lookup ever matched and
fast_mult was dropped from every row on regeneration. Fast messages then priced
at x1 instead of x2, halving reported cost on Opus 5 and 4.8.
Split the cell and key each name separately. mergeRows now also carries an
established fast_mult forward when the model has dropped off the fast table
(Opus 4.7 has), so transcripts recorded while that lane was offered keep pricing
correctly instead of reverting to x1. Deleting the field by hand still sticks.
The refresh workflow now writes a minor changeset alongside pricing.json:
the file ships inside the published ccsidekick package, so CI's changeset gate
failed every automated pricing PR. A fixed filename keeps re-runs idempotent.
Co-Authored-By: Penny-One (Batcave) <noreply@anthropic.com>
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 the bug behind #31, which is pure regression: its whole diff was the deletion of
fast_mult, with no rate change at all.The bug
The published fast-mode table now bills one shared lane for several models by naming them in a single cell:
buildFastInputkeyed the map on the raw cell text, so the lookups for"Claude Opus 5"and"Claude Opus 4.8"never matched.fast_multwas therefore never derived, andmergeRowsreplaced each row wholesale and dropped the field.Downstream,
fast_multdefaults to1(pricing.ts:56) and gates the speed multiplier (pricing.ts:188), so fast-mode messages on Opus 5 and 4.8 priced at ×1 instead of ×2 — reporting half their true cost.Changes
buildFastInputsplits the cell and keys each model name separately.mergeRowscarries an establishedfast_multforward when a model has dropped off the fast table. Opus 4.7 has, and transcripts recorded while that lane was offered still need ×6 to price correctly. A model still listed is re-derived normally, and deleting the field by hand still sticks.pricing.json. That file ships inside the publishedccsidekickpackage, so CI's changeset gate failed on every automated pricing PR. A fixed filename keeps re-runs idempotent, since the branch is recreated frommaineach run.Why the tests were green while production drifted
The fixture pinned the old single-name table shape, so it tested the parser against a page that no longer exists. It now mirrors the live slash-combined row.
Verification
refresh-pricing.test.ts: 8 pass. Both new tests were confirmed failing first (Expected: 2, Received: undefined).bun run test: 1076 pass, 0 fail. The existing ×6 assertion for Opus 4.7 still passes, because the carry-forward leavespricing.jsonbyte-identical.refresh-pricing.ts --checkagainst the live page: in sync, withpricing.jsonunchanged — confirming chore(pricing): sync pricing.json with published rates #31's diff was entirely spurious.pricing.jsonedit plus the generated changeset:changeset status --since=origin/mainexits 0.typecheck,lint,format:checkclean.Follow-up
#31 should be closed rather than merged.
🦇 Generated by Penny-One at Batcave