Clear the Azure price of a model version the price list does not meter yet #331
Merged
posthog[bot](GitHub profile, opens in a new tab)merged 3 commits into
main fromrefs/pull/331/head·merged by tombeckenham View on GitHubProblem#
- The
pricing_lostalert fires 3 to 5 times each hour, against an upper bound of 0. A real price loss on any other provider is hidden in this noise. - Since 2026-10-15 at about 02:00 UTC, all of these events come from one row:
azure/gpt-chat-latest. They do not come from OpenCode. - Microsoft's models article now lists
gpt-chat-latest(2026-10-07), and the adapter uses the newest version. - The Azure Retail Prices API meters versions
0505,0528,0701, and0806of this model. It has no1007meter yet. azureModelRatesreturns null. Each 15-minute poll keeps the stored card and logs aparser_miss.- The kept card is for the 2026-08-06 version. The row now describes 2026-10-07, which has a different context window.
Origin#
- Issues: #307
- Scout:
signals-scout-insight-alerts - First signal: 2026-10-12
- Inbox report: open
- Task started by: auto-start, after the report was rated P2 and ready to fix
Changes#
- When every meter that names a model is for a different dated version, the adapter sets
absent.pricing: 'cleared'. The price list was read, and it visibly has no price for this version. - This follows the
FactAbsencecontract inproviders/types.ts. It is the same pattern as the Gemini fix (#311) and the OpenCode fix (#315). - The rule is narrow. A model with no meter, or with an undated meter, or a row with no version, still keeps its stored card and logs
pricing_lost. - When Azure publishes the
1007meter, the next poll writes the new card again.
| Row | Meters | Before | After |
|---|---|---|---|
gpt-chat-latest 2026-10-07 | 0505, 0528, 0701, 0806 | Keeps the 0806 card, logs pricing_lost each poll | Price is null, no signal |
gpt-chat-latest 2026-08-06 | same | Priced | Priced |
Model with no meter (gpt-5.6) | none | Keeps the card, logs pricing_lost | No change |
o3, no version | 0416 only | Keeps the card, logs pricing_lost | No change |
Warning
This is a product decision. #324 lists three options: wait, copy the newest priced version, or mark the price unavailable. This PR uses a fourth option, cleared. The served price of azure/gpt-chat-latest is null until Azure meters the 2026-10-07 version. Do not merge this if a stale card is better for the catalog than no card.
Testing#
bun run test src/server/providers/azure src/server/providers/adapters/azure src/server/ingest: all tests pass. The new test covers the cleared case and the two cases that are not cleared.bun run typecheck,eslint, andprettier --checkon the changed files: all pass.- I ran the new code against the live Learn article and the live price list. It clears only one chat row:
gpt-chat-latest2026-10-07. This is well below the bound inrefusesPriceClears, which refuses 5 or more clears.
Agent context#
- I rejected a copy of the 0806 price to the 1007 row. The source does not state that the two versions have the same price.
- I rejected
unavailable. It keeps a card for the wrong version, and it is meant for a source that cannot be read. - The OpenCode
jev-1.13events in the report are from 2026-10-13. They stopped before this alert episode, so this PR does not change them.
Closes #324
🤖 Generated with Claude Code
Created with PostHog Desktop from this inbox report, addressing #307.
- 1
tombeckenham merged this2981fa1
tombeckenham closed this
Sign in to join this conversation.
Deploying with
Cloudflare Workers#
The latest updates on your project. Learn more about integrating Git with Workers.
View logs
Branch Preview URL