Skip to content

Pricing precedence hands retired first-party models to resellers after snapshot refresh #524

Description

@willwashburn

Problem

The #510 vendored models.dev refresh deleted retired first-party model entries while reseller providers kept their copies. flatten (crates/relayburn-sdk/src/analyze/pricing.rs:183-222) only protects a model when the primary vendor still publishes it (PRIMARY_PRICING_PROVIDERS, pricing.rs:127-131), so last-wins silently hands such models to a reseller tariff instead of flagging them unpriced.

36 models switched from first-party to reseller pricing on main. Worst cases:

  • claude-sonnet-4-20250514: anthropic 3/15 (cache_read 0.30, cache_write 3.75) → jiekou 2.7/13.5 with NO cache fields. cache_read.unwrap_or(0.0) (pricing.rs:205) bills cache reads at $0.00 and cache_write.unwrap_or(input) (pricing.rs:209) drops cache creation 3.75→2.7 — cache_read is usually the dominant bucket for Claude Code sessions, so cost is drastically under-reported.
  • claude-opus-4-20250514: 15/75 → 13.5/67.5, cache pricing gone.
  • gemini-2.5-flash-preview-05-20: output 0.6 → 3.15 (5.25× over-report).
  • gemini-2.5-pro-preview-05-06: input 1.25 → 2.5 (2× over).
  • gpt-5-codex: 1.25/10 → 1.125/9 — this is why BURN_GOLDEN=1 golden cases summary/summary-json fail on main tip (snapshot $0.0065 vs binary $0.0059).

Attribution: all three inputs to the failing golden cases are identical at main tip 5b531d0 — the defect is on main, not in any open branch.

Fix

When a primary vendor previously published a model and the refreshed snapshot no longer carries it, treat the model as unpriced (route through the unpriced-usage path #510 added) rather than falling through to a reseller. Do NOT regenerate the golden snapshots — that would bake reseller prices into the expectations.

Related

#509 (override loading), #503/#510 (precedence groundwork), #522 (scheduled refresh workflow — its test gate will trip on this class of change until fixed).

Found during retroactive adversarial review of PR #511's merge delta.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions