Skip to content

skillopt: add Opus 4.8 to anthropic-pricing.ts (cost-cap silently no-ops) #1819

@garrytan

Description

@garrytan

Summary

models.aliases.opus is now set to anthropic:claude-opus-4-8 (released 2026-05-28). But src/core/anthropic-pricing.ts (ANTHROPIC_PRICING) only has entries for claude-opus-4-7 and claude-opus-4-6 — there is no claude-opus-4-8 row.

Impact

estimateMaxCostUsd() returns null for any model not in the table. When pricing is null, the skillopt cost preflight has no estimate to compare against --max-cost-usd, so the hard cost cap silently no-ops on 4.8 runs. A run that should refuse at the cap will instead proceed unbounded.

This also affects the dream-cycle budget meter (same pricing source) — non-priced models hit the BUDGET_METER_NO_PRICING warn path and bypass the budget gate.

Fix

Add to ANTHROPIC_PRICING in src/core/anthropic-pricing.ts:

'claude-opus-4-8': { input: 5.00, output: 25.00 },

Same per-token pricing as 4-7 ($5 in / $25 out per 1M tokens), confirmed against Anthropic's published pricing.

Repro

  1. gbrain config set models.aliases.opus anthropic:claude-opus-4-8
  2. gbrain skillopt <skill> --bootstrap-from-skill --dry-run
  3. Cost estimate line shows no refusal even when projected spend exceeds --max-cost-usd.

Notes

Found while upgrading all gbrain tiers from Opus 4.7 → 4.8. Config flip done via models.aliases.opus override; this pricing gap is the one residual.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions