chore(pricing): sync pricing.json with published rates - #31
Closed
github-actions[bot] wants to merge 1 commit into
Closed
chore(pricing): sync pricing.json with published rates#31github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
github-actions
Bot
force-pushed
the
automated/pricing-refresh
branch
from
August 7, 2026 07:40
f6b03cd to
8866cad
Compare
krayong
added a commit
that referenced
this pull request
Aug 7, 2026
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: ``` ["Claude Opus 5 / Claude Opus 4.8", "$10 / MTok", "$50 / MTok"] ``` `buildFastInput` keyed the map on the raw cell text, so the lookups for `"Claude Opus 5"` and `"Claude Opus 4.8"` never matched. `fast_mult` was therefore never derived, and `mergeRows` replaced each row wholesale and dropped the field. Downstream, `fast_mult` defaults to `1` (`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 - **`buildFastInput` splits the cell** and keys each model name separately. - **`mergeRows` carries an established `fast_mult` forward** 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. - **The refresh workflow now writes a minor changeset** next to `pricing.json`. That file ships inside the published `ccsidekick` package, so CI's changeset gate failed on every automated pricing PR. A fixed filename keeps re-runs idempotent, since the branch is recreated from `main` each 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 leaves `pricing.json` byte-identical. - `refresh-pricing.ts --check` against the live page: **in sync**, with `pricing.json` unchanged — confirming #31's diff was entirely spurious. - The changeset gate was simulated in a scratch worktree by committing a `pricing.json` edit plus the generated changeset: `changeset status --since=origin/main` exits 0. - `typecheck`, `lint`, `format:check` clean. ## Follow-up #31 should be closed rather than merged. 🦇 Generated by [Penny-One](https://batman.fandom.com/wiki/Alfred_Pennyworth) at [Batcave](https://batman.fandom.com/wiki/Batcave) 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.
Automated daily sync from the Anthropic pricing page. Review the rate changes before merging.