Skip to content

Dedup identical opus-tier rate rows in modelPricing.js EXACT_RATES #4163

Description

@atomantic

In server/lib/modelPricing.js, all five claude-opus-* rows in EXACT_RATES (~lines 39-43) carry an identical [5.0, 25.0] rate pair:

'claude-opus-5': [5.0, 25.0],
'claude-opus-4-8': [5.0, 25.0],
'claude-opus-4-7': [5.0, 25.0],
'claude-opus-4-6': [5.0, 25.0],
'claude-opus-4-5': [5.0, 25.0],

Confirmed still the case. Because of this, the { test: /opus/i, rateModel: 'claude-opus-5' } line in FAMILY_RULES (~line 97) must be re-pointed at every model bump purely for zero behavioral effect — it only relabels the reported rateModel for unrecognized opus ids to whichever pointer key currently has the rates, since every opus row already resolves to the same numbers.

Fix shape

Either:

  1. Extract a shared const OPUS_TIER_RATES = [5.0, 25.0] and reference it from every claude-opus-* row plus the FAMILY_RULES fallback, so the pointer bump becomes unnecessary (the fallback can point at the constant directly instead of a specific model id), or
  2. Let a family rule yield rates directly ({ test: /opus/i, rates: [5.0, 25.0] }) instead of pointing at a peer EXACT_RATES key.

Either retires the per-bump FAMILY_RULES edit that migration 206 (and every opus bump before it) had to make for no behavioral change.

Low priority — listed for completeness, not urgency. Surfaced alongside the migration-skeleton factoring item on the opus-5 PR.

Migrated from PLAN.md by /do:replan --issues.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

code-qualityProposed from a code-quality audit

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions