🤖 feat: add support for Claude Opus 5 - #3750
Conversation
Promotes Claude Opus 5 (released July 24, 2026) to the default opus/OPUS model in place of Opus 4.8. Same pricing and envelope as 4.8: $5/$25 per MTok, native 1M context, 128K max output. The existing native-xhigh regex already routes Opus 5 through adaptive thinking, summarized display, and the full effort ladder including native xhigh and max; the Opus 5 restriction that disabled thinking is only legal at effort high or below is satisfied because "off" maps to effort low. --- _Generated with `mux` • Model: `anthropic:claude-fable-5` • Thinking: `xhigh` • Cost: `$13.54`_ <!-- mux-attribution: model=anthropic:claude-fable-5 thinking=xhigh costs=13.54 -->
|
@codex review |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 873a944914
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
## Summary Prepares Xum for the Claude Fable 5.1 drop: promotes Fable 5.1 (`anthropic:claude-fable-5-1`) to the `FABLE` known model, so the `fable` alias, the `/fable` command, tokenizer warming, and the default refusal-fallback chain all route to the new model. Fable 5 stays usable as the custom model string `anthropic:claude-fable-5` and keeps its metadata entry and tokenizer approximation. > [!NOTE] > **Launch confirmed.** Anthropic released Claude Fable 5.1 on September 1, 2026. All assumptions below were verified against the official model overview; the API id and $10/$50 pricing were correct as assumed. The one correction: cache reads are $0.25/M (0.025x input), a quarter of the assumed 0.1x ratio, fixed in `models-extra.ts`. ## Background This PR was prepared ahead of the drop (same play as the Opus 5 promotion in coder#3750), with assumptions confirmed on release day against the official docs: - **API id**: `claude-fable-5-1` (dash form, dateless, matching the 5-generation convention of `claude-sonnet-5` / `claude-opus-5` and the dash style of `claude-haiku-4-5`). - **Pricing**: unchanged from Fable 5 for input/output, $10/M input, $50/M output, cache write 1.25x input. Cache read turned out cheaper at launch: $0.25/M (0.025x input), corrected in this PR. - **Envelope**: unchanged, native 1M context, 128K max output, full effort ladder with native xhigh and max, adaptive thinking only (disabled thinking rejected), safeguard classifiers retained so the refusal fallback stays relevant. ## Implementation - `knownModels.ts`: `FABLE` -> `claude-fable-5-1` (keeps the `fable` alias and tokenizer warming; tokenizer override stays on the Opus 4.5 approximation). - `models-extra.ts`: new `claude-fable-5-1` pricing/limits entry; the Fable 5 entry is retained. - `models.ts`: `claude-fable-5-1` added to the native-1M patterns (the existing `claude-fable-5` pattern only tolerates date suffixes, not `-1`). - No wire-format changes needed for thinking/effort: the Mythos-class wildcard matchers (`anthropicSupportsNativeXhigh`, `anthropicRejectsDisabledThinking`) and native web-fetch id parsing already match the new id; tests now pin that. - **Fallback seed migration**: `DEFAULT_MODEL_FALLBACKS` is keyed by the FABLE id and the one-time seed is guarded by `migrations.defaultModelFallbacksSeeded`, so already-seeded configs would never get a chain for the new source key. A second one-shot flag (`defaultModelFallbacksSeededFable51`) re-runs the gap-check once: pre-5.1 configs get the Fable 5.1 -> Opus chain, an existing 5.1 chain is never overwritten, and the legacy Fable 5 chain is left byte-identical on disk. - **Downgrade safety** (Codex round 1): completing the original seed pass claims `defaultModelFallbacksSeeded`, which pre-5.1 builds trust for their own `claude-fable-5` key. The original seed pass (and the fresh-install default config) now also carries a `LEGACY_DEFAULT_MODEL_FALLBACKS` chain for `anthropic:claude-fable-5`, so a downgrade still finds its expected default instead of silently losing refusal fallback. - **Legacy tokenizer overrides** (Codex round 1): `TOKENIZER_MODEL_OVERRIDES` is derived from current KNOWN_MODELS ids, so retiring an id dropped its approximate-tokenizer mapping. A `LEGACY_TOKENIZER_MODEL_OVERRIDES` map retains `anthropic:claude-fable-5` and the identical pre-existing case `anthropic:claude-opus-4-8`; exact-id lookup resolves both to the intended Opus 4.5 approximation instead of warning and falling back to the generic per-provider tokenizer. - Docs model table and built-in skill content regenerated. - **Launch-day verification**: rebased onto main and corrected the `models-extra.ts` cache-read cost to the official $0.25/M; everything else matched the official model page. ## Validation - Behavioral coverage added for the new id: native-1M classification, display formatting (`Fable 5.1`), 5-level thinking policy with off-clamp, provider options (adaptive + summarized display, no disabled thinking), native web-fetch support, and the config seeding semantics (legacy chain carried by the original seed pass, 5.1 chain seeded once for pre-5.1 configs, existing 5.1 chains and deletions respected). - The WorkflowRunner alias-mapping test caught the alias flip (`fable` -> 5.1) and was updated; remaining `claude-fable-5` fixtures were audited and stay valid as explicit custom model strings. ## Risks Low: additive registry/metadata changes plus config migration flags. The main user-visible effect is that the `fable` alias and `/fable` route to Fable 5.1. Until the model exists at the API, alias sends would fail, which is why the merge gate above matters. Existing Fable 5 selections and user-edited fallback chains are unaffected; note that with current ai-tokenizer data the legacy tokenizer fix changes no token counts (both approximations share the `claude` encoding), it removes warning spam and future drift risk. --- _Generated with `xum` • Model: `anthropic:claude-fable-5` • Thinking: `xhigh` • Cost: `$45.64`_ <!-- mux-attribution: model=anthropic:claude-fable-5 thinking=xhigh costs=45.64 -->
## Summary Prepares Xum for the Claude Opus 5.5 drop: promotes Opus 5.5 (`anthropic:claude-opus-5-5`) to the `OPUS` known model, so the `opus` alias, the `/opus` command, tokenizer warming, the default model, the mux-gateway first-time model list, and the CI agent workflows all route to the new model. Opus 5 stays usable as the custom model string `anthropic:claude-opus-5` and keeps its metadata entry and tokenizer approximation. > [!IMPORTANT] > **Opus 5.5 launched Sept 22, 2026** ([announcement](https://www.anthropic.com/claude-opus-5-5), [what's new](https://platform.claude.com/docs/en/models/opus-5-5/whats-new-opus-5-5)). Every provisional value below was verified against the official docs in `c86761dae`; the launch checklist tracks what is still open. Undrafted Sept 22 18:07 UTC on the maintainer's instruction to merge once CI is green; that triggered Codex's final-head code + security reviews on `c86761dae` (both completed clean, 👍). **Scope note (Sept 22):** this PR was originally prepared as an _Opus 5.1_ promotion. Opus 5.1 never shipped — the Sept 1 wave was Fable 5.1 / Mythos 5.1 only and `main` still ships `claude-opus-5` — so rather than promoting a nonexistent id, the same PR was retargeted in place to the anticipated Opus 5.5 launch (mechanical id/label rename + repricing; commit `605816945`), then aligned with the official launch docs (`c86761dae`). The review record below was earned on the 5.1-era diff and is preserved; no new review loops were run for the retarget or the alignment. ## Background This PR was prepared ahead of the drop (same play as the Opus 5 promotion in coder#3750 and the Fable 5.1 promotion in coder#3988) and then verified against the official docs on launch day: - **API id** ✅ `claude-opus-5-5` (Claude API; Bedrock `anthropic.claude-opus-5-5`, Vertex/Foundry `claude-opus-5-5`). - **Pricing** ✅ $4/M input, $20/M output; 5-minute cache write $5/M (1.25×); cache read $0.20/M (0.05×). The 1-hour cache-write tier ($8/M, 2×) and fast mode ($8/$40) have no field/entry in `models-extra.ts`, matching how Opus 5 is modelled (noted in the entry comment). - **Envelope** ✅ native 1M context, 128K max output, effort ladder with native xhigh + max; default effort `medium` (Xum's default is already `medium`). - **Breaking changes vs Opus 5** (docs "What's new"): (1) thinking **cannot be disabled** — `disabled` and `enabled+budget_tokens` both return 400 → handled in `c86761dae`; (2) forced `tool_choice` any/tool returns 400 → Xum only forces tool choice for xai, so no change; (3) thinking blocks are bound to the producing model (Opus 5 → 5.5 keeps reasoning; Fable/Mythos → 5.5 drops it) → informational; (4) `computer_20251124` not accepted → not referenced in the repo; (5) Opus 5.5 ships the Fable-class safeguard classifiers → it is not a proven refusal-fallback _target_, see Implementation. ## Implementation - `knownModels.ts`: `OPUS` -> `claude-opus-5-5` (keeps the `opus` alias, warming, and the Opus 4.5 tokenizer approximation). The retired `anthropic:claude-opus-5` id joins `LEGACY_TOKENIZER_MODEL_OVERRIDES` (alongside main's `claude-fable-5` / `claude-mythos-5` entries) so exact-id lookup keeps its approximation instead of warning and falling back to the generic per-provider tokenizer. - `models-extra.ts`: new `claude-opus-5-5` pricing/limits entry (official numbers); the Opus 5 entry is retained. - `models.ts`: `claude-opus-5-5` added to the native-1M patterns — the existing `claude-opus-5` pattern only tolerates date suffixes, not `-5` (the exact trap coder#3988 documented for Fable). - Thinking/effort wire format: `anthropicSupportsNativeXhigh` already matches any Opus 5+ (`claude-opus-[5-9]`, unanchored) and the native web-fetch parser reads `claude-opus-5-5` as major 5 / minor 5. **`anthropicRejectsDisabledThinking` now also matches the exact `claude-opus-5-5` id** (optional date suffix, Bedrock `anthropic.` prefix tolerated), so the thinking policy offers `low..max` without "off" (a requested "off" clamps to `low`, as for Fable/Mythos) and provider options omit `thinking` on a stray "off" instead of sending the rejected `{ type: "disabled" }`. Opus 5 keeps its 6-level ladder. Tests pin all of this plus display formatting (`Opus 5.5`). - **Refusal-fallback target stays Opus 5** (decision on launch day, replacing the earlier chain-target migration): Opus 5.5 ships the same safeguard classifiers as Fable 5.1, so it is not a proven recovery target for Fable refusals. `DEFAULT_MODEL_FALLBACKS` and `LEGACY_DEFAULT_MODEL_FALLBACKS` pin the literal `anthropic:claude-opus-5` instead of `KNOWN_MODELS.OPUS.id`, so fresh installs and already-seeded configs keep byte-identical `Fable 5.1 → Opus 5` / `Fable 5 → Opus 5` chains with no migration or new flag. The one-shot `defaultModelFallbacksSeededOpus55` migration and `SUPERSEDED_DEFAULT_MODEL_FALLBACKS` from the reviewed diff were removed as no longer needed (pure deletion; `config/index.ts` and `appConfigOnDisk.ts` are back to `main`). **Follow-up:** evaluate Opus 5.5 as a fallback target (or `Opus 5.5 → Opus 5` as a new default chain) once its refusal behavior is known. - Gateway first-time defaults (`providerService.ts`), CI agent workflows (auto-cleanup, terminal-bench), terminal-bench leaderboard `MODEL_METADATA`, docs model table, `docs/guides/github-actions.mdx`, and built-in skill content regenerated — mirroring coder#3750's surface set. ## Validation - Behavioral coverage for the new id: native-1M classification (incl. gateway-prefixed form), 5-level thinking policy with "off" excluded and clamped to `low` (Opus 5 and a Bedrock-style `anthropic.claude-opus-5-5` id covered as boundaries), provider options (adaptive + summarized display, native xhigh/max effort, `thinking` omitted on "off"), native web-fetch support, display formatting, alias/tokenizer-override registry wiring, and the unchanged fallback seeding semantics with the target pinned to Opus 5. - Audited remaining `anthropic:claude-opus-5` fixtures: all use it as an explicit custom model string, which stays valid; default-model-derived fixtures (CLI `--help`, workspace creation, e2e display name) were updated. - 5.5 retarget (`605816945`): zero `5-1`/`5.1`/`Opus51` residue outside the regenerated skill file; the nine model/config/provider suites pass on the pinned Bun (754 tests, 0 failures); `make static-check` green. - Launch alignment (`c86761dae`): eleven model/config/provider/thinking/aiService suites pass on the pinned Bun (929 tests, 0 failures) plus the eight suites that reference the `OPUS` default (207 pass); `make static-check` green. CI on the final head is the authoritative gate. <details> <summary>Earlier 5.1-era validation (rebase + full unit suite classification)</summary> Rebase onto `main` (post-coder#3988-merge) re-verified: conflicts resolved additively (Mythos 5.1 promotion, gemini 3.8 fixture churn, `config.ts` → `config/index.ts` split) and `make static-check` green. The full unit suite was re-run locally on the pinned Bun in fail-closed chunks; every failure was classified as pre-existing: a host git `init.templateDir` quirk (passes with `GIT_TEMPLATE_DIR` set), Storybook snapshot-budget and BackupRepoCache failures that reproduce identically on clean `origin/main`, and suite-load flakes that pass in isolation. </details> ### Review record Six review rounds were used on the 5.1-era diff (round 1: Codex code review with one P2 fixed + security review; rounds 2–3: clean code + security pairs, the last on `e78cf41e7`). The independent advisor pass recommended **ready with tracked release follow-ups** (the launch checklist below), held as draft. The 5.5 retarget (mechanical rename + reprice) and the launch alignment (`anthropicRejectsDisabledThinking` match for Opus 5.5, removal of the chain-target migration) sit on top of that reviewed diff and did not open new review loops, so those six reviews and the advisor recommendation apply to `e78cf41e7`; the final head `c86761dae` is covered by the automatic code + security pair described in the note below. A second advisor consultation on launch day recommended dropping the target migration (scope reduction) rather than migrating users' recovery chains onto a classifier-bearing model; a third advised holding at the six-review cap, which the maintainer's explicit merge instruction superseded. > [!NOTE] > **Final-head review record.** Six Codex reviews (three code + security pairs on `26d3cc49`, `2259d651`, `e78cf41e`) were completed under the six-review budget. Marking the PR ready for review on Sept 22 (required for merge) triggered Codex's automatic final-head pair on `c86761dae` — code review and security review both **Completed** with no findings (👍, no threads) — bringing the total to **eight completed assessments**. The two extra assessments were accepted deliberately to satisfy the "required checks must cover the final commit" rule after the maintainer authorized delivery; no fix rounds resulted from them. ### Launch checklist (before undrafting) 1. ~~Confirm the official API id is `claude-opus-5-5`~~ ✅ verified Sept 22 (Claude API / Bedrock / Vertex / Foundry ids in the docs). 2. ~~Confirm pricing~~ ✅ $4/$20, 5-min cache write $5, cache read $0.20 verified; 1-hour cache write ($8) and fast mode ($8/$40) intentionally not modelled (same as Opus 5). 3. ~~Confirm envelope~~ ✅ 1M/128K, native xhigh + max verified; thinking-off **not** allowed and safeguard classifiers **present** — both handled in `c86761dae` (policy drops "off"; fallback target pinned to Opus 5, migration removed). 4. ~~Obtain clean Codex code **and** security reviews for the final commit~~ ✅ both completed clean on `c86761dae` (Sept 22, trigger: draft marked ready); `Codex Comments` + `Required` re-run on that same commit. ## Risks Low: additive registry/metadata changes, no config migration. The main user-visible effects are that the `opus` alias, `/opus`, and the default model route to Opus 5.5, and that users on the `opus` alias lose the thinking "off" level (persisted "off" clamps to `low`, matching the API's always-on thinking). Existing Opus 5 selections and all fallback chains (default or user-edited) are unaffected. Cost tracking uses the official $4/$20 and $0.20/M cache-read prices; 1-hour cache writes are under-counted at the 5-minute rate, as for every other Anthropic entry. --- _Generated with `xum` • Model: `coder:anthropic/claude-fable-5-1` • Thinking: `xhigh` • Cost: `$106.53`_ <!-- mux-attribution: model=coder:anthropic/claude-fable-5-1 thinking=xhigh costs=106.53 -->
Summary
Adds first-class support for Claude Opus 5 (released July 24, 2026) and promotes it to Mux's default
opus/OPUSmodel in place of Opus 4.8.Background
Anthropic shipped Opus 5 as the successor to Opus 4.8 with the same pricing and envelope, verified against the official What's new in Claude Opus 5 and pricing pages:
claude-opus-5(dateless, same convention as Sonnet 5 / Fable 5).lowthroughmax, nativexhigh), thinking on by default, no beta header.Per the request-handling review: Opus 5 introduces one breaking API change vs 4.8,
thinking: {type: "disabled"}returns 400 when effort isxhighormax. Mux is unaffected because theoffthinking level maps to effortlow, and all other levels send adaptive thinking. The existinganthropicSupportsNativeXhigh()regex already matchesclaude-opus-5, so adaptive thinking,display: "summarized", and native xhigh/max effort apply automatically with no wire-format changes. New Opus 5 beta features (mid-conversation tool changes, server-side default fallbacks) and fast mode were deliberately not adopted.Implementation
knownModels.ts:OPUS→claude-opus-5(keepsopusalias, app default, and the Fable→Opus refusal fallback via the shared constant). Tokenizer override stays onanthropic/claude-opus-4.5for approximate counting since the newer 4.7+ tokenizer is not published upstream.models-extra.ts: newclaude-opus-5pricing/limits entry.models.ts:claude-opus-5added to the native-1M patterns (not the beta-header toggle).providerService.ts: mux-gateway first-time default model list now seeds Opus 5.claude-opus-5has no minor version to exercise dot-vs-dash normalization.Risks
Low. Opus 4.8 remains usable as a custom model string (
anthropic:claude-opus-4-8); its metadata entry is retained. The main user-visible effect is that theopusalias and default model route to Opus 5. Existing per-user fallback chains are not migrated (seed-once semantics preserved).Generated with
mux• Model:anthropic:claude-fable-5• Thinking:xhigh• Cost:$28.06