Fix gemini flash 3 preview price#10315
Conversation
|
Greptile SummaryThis PR fixes a copy-paste bug in Confidence Score: 5/5Safe to merge — this is a correct data-only bug fix with no logic changes. The pricing values are confirmed against official Google AI pricing documentation ($0.50 input, $3.00 output, $0.05 cached reads). Setting cacheWritesPrice to 0 follows the established pattern for Gemini models in this codebase (writes billed at standard input rate). The removed tiers had identical values for both context-window tiers and incorrect prices, so their removal is correct. No logic or behavioral code was changed. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/shared/api.ts | Fixes cacheReadsPrice/cacheWritesPrice swap for gemini-3-flash-preview in both vertexModels and geminiModels, and removes duplicate/incorrect tiers; all values align with official Google pricing. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[gemini-3-flash-preview token used from cache] --> B{cacheReadsPrice defined?}
B -- "Before PR: No (missing field)" --> C["cacheReadsPrice = 0 (free)"]
B -- "After PR: Yes = 0.05" --> D["cacheReadsPrice = $0.05 / 1M tokens"]
C --> E["User undercharged — bug"]
D --> F["Correct billing"]
A2[gemini-3-flash-preview cache written] --> G{cacheWritesPrice}
G -- "Before PR: 0.05 (wrong field)" --> H["Pricing logic misled"]
G -- "After PR: 0 (correct)" --> I["Writes billed at standard inputPrice"]
Reviews (1): Last reviewed commit: "correct gemini flash 3 preview price" | Re-trigger Greptile
Currently Cline's api.ts has wrong info on gemini-3-flash-preview model. The config says "cacheWritesPrice" is 0.05 and totally skips cacheReadsPrice. The code interprets this as free cache reads (0 cost) which breaks the pricing calculation while using the aforementioned model. This PR fixes that.
Related Issue
Issue: 10314
Description
Test Procedure
Type of Change
Pre-flight Checklist
npm test) and code is formatted and linted (npm run format && npm run lint)Screenshots
Additional Notes