feat: price Claude Opus 5 + fix adaptive-thinking gate for 4.7/4.8/5 - #27
Conversation
Opus 5 replaced Opus 4.8 as the worker default (2026-07-29, same $5/$25
pricing tier). Adds it to the pricing match arm and its own regression test.
While validating, found supports_adaptive_thinking() only matched the
literal "4-6" string, so Opus 4.7, Opus 4.8, and now Opus 5 never got
thinking:{type:"adaptive"} set — silently running with thinking off this
whole time. Widened the gate to the full 4.6+-generation family (checked
against the live Models API capability data) and added regression tests
covering it.
PR Review1. SummaryThis PR adds pricing for Claude Opus 5 ($5/$25 tier) and refactors the adaptive-thinking gate from a hardcoded 4.6-only check to a fragment-list approach covering Opus 4.7/4.8/5, Sonnet 5, and fable/mythos-5. Both changes include regression tests. 2. FindingsP2 — Potential substring over-match in
|
|
✅ PR approved — waiting for a human merge. human-authored PR — the manual ship gate applies by design. Converged auto-merge (policy 2026-07-03) covers platform-authored PRs only; merge when you're ready |
Summary
claude-opus-5) replaces Opus 4.8 as the worker default in production config (/data/spacebot/data/config.toml, already applied on lira 2026-07-29). Same $5/$25 pricing tier as Opus 4.5+ — verified live againstplatform.claude.com/docs/en/about-claude/pricingand via the Models API (GET /v1/models/claude-opus-5,created_at: 2026-07-24). Added a pricing regression test alongside the existing Opus 4.8 test (not replacing it).supports_adaptive_thinking()only matched the literal"4-6"substring, so Opus 4.7, Opus 4.8, and now Opus 5 never gotthinking: {type: "adaptive"}set on requests — they've been silently running with thinking disabled. Widened the gate to the full 4.6-generation-and-later family (checked against live Models API capability data — all of Opus 4.6/4.7/4.8/5 and Sonnet 4.6/5 and Fable/Mythos 5 showthinking.types.adaptive.supported: true). Added regression tests for the previously-missed models.Test plan
cargo test(I don't have a local Rust toolchain — could not run tests before opening this PR; both changes are small and mechanical — a new pricing match arm and an array-based substring gate — but please confirm CI is green before merging)claude-opus-5inference end-to-end via the real Claude-Code-identity/OAuth code path (claude_api.call()) before wiring it as the default — see conversation context