v0.42.25.0 fix(pricing): unify chat-model pricing into one canonical source; add Opus 4.8 (#1819)#1827
Merged
Merged
Conversation
… Opus 4.8 (#1819) Single canonical CANONICAL_PRICING table (src/core/model-pricing.ts) with canonicalLookup; ANTHROPIC_PRICING and takes-quality MODEL_PRICING become derived views. cost-tracker, cross-modal runner, skillopt preflight, brainstorm orchestrator, and brain-score all source from it. Adds Opus 4.8 ($5/$25) so --max-cost-usd and the dream-cycle budget meter enforce on 4.8 runs; fixes a stale Opus 4.7 $15/$75 in the takes-quality gate and reconciles Gemini 2.0 Flash to $0.10/$0.40. Because every table derives from canonical, cross-table price drift is structurally impossible.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add KEY_FILES.md entries for src/core/model-pricing.ts (canonical CANONICAL_PRICING + canonicalLookup) and refresh the now-derived anthropic-pricing.ts + takes-quality-eval/pricing.ts entries to current-state. Add the "one canonical chat-pricing table" cross-cutting invariant to CLAUDE.md. Fix the stale model-price snapshot pointer in SEARCH_MODE_METHODOLOGY.md (anthropic-pricing.ts -> model-pricing.ts). Regenerate llms-full.txt. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…1819 # Conflicts: # CHANGELOG.md # VERSION # package.json
…1819 # Conflicts: # CHANGELOG.md # VERSION # package.json
…1819 # Conflicts: # CHANGELOG.md # VERSION # package.json
mgunnin
added a commit
to mgunnin/gbrain
that referenced
this pull request
Jun 5, 2026
* upstream/master: v0.42.26.0 docs(supabase): update connection-string setup to new UI + Transaction pooler (garrytan#1848) (garrytan#1875) v0.42.25.0 fix(pricing): unify chat-model pricing into one canonical source; add Opus 4.8 (garrytan#1819) (garrytan#1827) v0.42.24.0 fix(minions): route lock claim/renewLock through direct session pool (garrytan#1822)
mdcruz88
added a commit
to mdcruz88/gbrain
that referenced
this pull request
Jun 6, 2026
…wlist entries DEFAULT_SLOTS A and C referenced models the gateway no longer accepts, so both slots failed on every run and forced an INCONCLUSIVE verdict even when the output was genuinely good: - Slot A: openai:gpt-4o was dropped from the OpenAI recipe chat allowlist. - Slot C: google:gemini-1.5-pro was retired by Google upstream. Bump all three slots to current, allowlisted flagships (src/core/ai/recipes/): - Slot A: openai:gpt-4o -> openai:gpt-5.2 - Slot B: anthropic:claude-opus-4-7 -> anthropic:claude-opus-4-8 - Slot C: google:gemini-1.5-pro -> google:gemini-2.0-flash claude-opus-4-8 was already in the canonical pricing table (PR garrytan#1827) but not yet in the anthropic recipe's chat allowlist, so add it there to keep slot B valid (claude-opus-4-7 retained for the many call sites that still default to it). gpt-5.2 and gemini-2.0-flash are already allowlisted. The original patch also edited an inline PRICING map in estimateCost(); PR garrytan#1827 replaced that map with canonicalLookup() from src/core/model-pricing.ts, so that hunk is obsolete and dropped on rebase. (Cost estimation for gpt-5.2 falls to the "no pricing on file" note since canonical pricing carries gpt-5 and gpt-5.5 but not gpt-5.2 — cosmetic, does not affect the run.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes gbrain#1819 and unifies all chat-model pricing into one canonical source.
The bug (#1819): Opus 4.8 (
models.aliases.opus) had no price on file, so cost guardrails silently failed — thegbrain dreambudget meter let runs proceed unbounded (BUDGET_METER_NO_PRICINGwarn + skip), andgbrain skillopt --max-cost-usdfell back to a cheaper tier's rate and refused too late. Adds Opus 4.8 at $5/$25 so the caps enforce again.The unification: prices were hand-copied across five budget-gating tables and had drifted — one eval gate priced Opus 4.7 at a stale $15/$75 (3x high), and Gemini 2.0 Flash disagreed between two tables. All chat-model prices now live in one canonical table (
src/core/model-pricing.ts); the Anthropic bare-key view, the takes-quality fail-closed allowlist, the contradictions cost-tracker, the cross-modal eval panel, and the skillopt preflight all derive from it. Cross-table drift is now structurally impossible.Commits:
fix(pricing)— canonicalCANONICAL_PRICING+canonicalLookup; derived views; consumers rewired; Opus 4.8 added; stale Opus 4.7 ($15/$75→$5/$25) and Gemini 2.0 Flash ($0.30/$1.20→$0.10/$0.40, verified) fixed; brainstorm/brain-score now price provider-prefixed ids.docs— KEY_FILES.md entry formodel-pricing.ts, CLAUDE.md "one canonical chat-pricing table" invariant, llms bundle regenerated.Test Coverage
Tests: new
test/model-pricing.test.ts(integrity + canonicalLookup matrix + drift guard + S1A + import-cycle guard); updatedanthropic-pricing.test.ts(opus-4-8 math) andeval-takes-quality-pricing.test.ts(opus-4-7 regression + opus-4-8). Full suite: 13,216 pass / 0 real failures.Pre-Landing Review
SHIP — no CRITICAL. Enum/value completeness verified (opus-4-8 traced through every consumer). Applied doc-only auto-fixes: honest drift-guard framing (the guard is a re-hardcode trip-wire — drift is structurally impossible since views are derived), corrected a stale skillopt header comment, fixed a test-path reference.
Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Scope Drift
Scope Check: CLEAN — diff matches the #1819 intent + the unification approved in plan review (D1A/D2B/S1A/S2A/S3A).
Plan Completion
25 DONE, 2 CHANGED (S1A used
canonicalLookupinstead of a literal prefix-strip — equivalent; correction #7 message updated), 0 NOT DONE. All locked decisions delivered.Adversarial review (always-on)
gbrain providersrecipe baselines (not consumed by any budget gate). None are regressions in this diff. Real follow-ups filed as TODOs.TODOS
ANTHROPIC_PRICINGconsolidation (this PR).budget-trackerthrough canonical for non-Anthropic;canonicalLookupcase-insensitivity;getPricingid normalization; module-load-throw negative test; recipe display-layer pricing refresh.Documentation
Docs synced to the canonical chat-pricing unification:
src/core/model-pricing.ts(canonical table); rewrote theanthropic-pricing.tsentry (was "single source of truth" → now a derived view); added the takes-quality derived-allowlist entry. Current-state only.test/model-pricing.test.ts).build-llmsfreshness test green).Closes #1819
This PR delivers the fix from gbrain#1819 (add Opus 4.8 pricing) plus the pricing-source unification that prevents the underlying drift class.
Test plan
cli.test.tstorn-reading VERSION/package.json mid-bump; passes 18/0 in isolation post-bump)bun run typecheckclean;bun build --compileclean🤖 Generated with Claude Code