Official Codebase of 3DCodeVerse
Python
pricing: claude-opus-5[1m] — the id the DEFAULT claude-code arm serves — had no row
gaoypeng49e8a800cdbf
diff --git a/harness/codeverse/models/pricing.py b/harness/codeverse/models/pricing.pyindex 9257952e..84994533 100644--- a/harness/codeverse/models/pricing.py+++ b/harness/codeverse/models/pricing.py@@ -113,6 +113,10 @@ PRICES: dict[tuple[str, str], Price] = {("anthropic", "claude-fable-5"): Price(10.00, 50.00, 1.00, cache_write=12.50),("anthropic", "claude-mythos-5"): Price(10.00, 50.00, 1.00, cache_write=12.50),("anthropic", "claude-opus-5"): Price(5.00, 25.00, 0.50, cache_write=6.25),+ # the 1M-context variant of opus-5, and the id the DEFAULT claude-code arm serves.+ # "[1m]" is not a version suffix, so it cannot prefix-match claude-opus-5 and priced+ # at $0.00 until 2026-08-24 (a recorded run billed $1.218 under this exact key).+ ("anthropic", "claude-opus-5[1m]"): Price(5.00, 25.00, 0.50, cache_write=6.25),("anthropic", "claude-opus-4-8"): Price(5.00, 25.00, 0.50, cache_write=6.25),("anthropic", "claude-opus-4-7"): Price(5.00, 25.00, 0.50, cache_write=6.25),("anthropic", "claude-opus-4-6"): Price(5.00, 25.00, 0.50, cache_write=6.25),@@ -177,6 +181,12 @@ PROVENANCE: dict[tuple[str, str], Provenance] = {("anthropic", "claude-fable-5"): _V("anthropic", note="1h cache write 20.00 (not modelled)"),("anthropic", "claude-mythos-5"): _V("anthropic", note="limited availability"),("anthropic", "claude-opus-5"): _V("anthropic", note="fast mode is 10.00/50.00 (not modelled)"),+ ("anthropic", "claude-opus-5[1m]"): _V("provider-cost", checked="2026-08-24", status="inferred",+ note="1M-context opus-5, served by the default claude-code arm. A probe "+ "billed costUSD 0.034620 for in=2, out=4, 1h-cache-write=3451 — "+ "exactly 2x5.00 + 4x25.00 + 3451x10.00 per 1M, i.e. the standard "+ "opus-5 rates with the 1h cache write at 2x input (not modelled here, "+ "as for every other Anthropic row)"),("anthropic", "claude-opus-4-8"): _V("anthropic", note="fast mode is 10.00/50.00 (not modelled)"),("anthropic", "claude-opus-4-7"): _V("anthropic"),("anthropic", "claude-opus-4-6"): _V("anthropic"),diff --git a/harness/tests/cost/test_price_hygiene.py b/harness/tests/cost/test_price_hygiene.pyindex a7b0d4b4..1791e5fa 100644--- a/harness/tests/cost/test_price_hygiene.py+++ b/harness/tests/cost/test_price_hygiene.py@@ -31,6 +31,7 @@ CORE_MODEL_IDS = ("openai:gpt-5.6-sol","anthropic:claude-fable-5","anthropic:claude-haiku-4-5-20251001",+ "anthropic:claude-opus-5[1m]", # what the DEFAULT claude-code arm reports (CC-2))@@ -114,6 +115,22 @@ def test_core_model_ids_resolve_to_a_price(model_id: str):assert estimate_cost(provider, model, u) > 0, model_id+def test_the_bracketed_context_variant_prices_on_its_own_row():+ """CC-2: '[1m]' is not a version/date/channel tag, so _is_version_suffix() refuses to+ fall back to claude-opus-5 — correctly, since a sibling's rate is never assumed here.+ The id is real (the default claude-code arm reports it, and one recorded cell billed+ $1.218 under it), so it needs a row of its own or `3dcv cost prices` calls the default+ arm unknown and estimate_cost values it $0.00."""+ row = price_provenance("anthropic", "claude-opus-5[1m]")+ assert row.match == "exact" and row.price is not None+ assert row.provenance.status == "inferred" and row.provenance.checked >= "2026-08-24"+ u = Usage(input_tokens=2, output_tokens=46_921)+ assert estimate_cost("anthropic", "claude-opus-5[1m]", u) == pytest.approx(+ estimate_cost("anthropic", "claude-opus-5", u)), "same rates as the standard-context row"+ # a bracketed suffix still must not borrow a sibling's price by accident+ assert price_provenance("anthropic", "claude-sonnet-5[1m]").price is None++def test_every_recorded_model_id_resolves_to_a_price():"""No silent $0: a model that billed us in a recorded run must have a row."""unknown = sorted(f"{p}:{m}" for p, m in _recorded_model_ids()