🤖 feat: add support for Claude Opus 4.8#3409
Conversation
Anthropic released Claude Opus 4.8 on May 28, 2026. It's a same-shape successor to Opus 4.7 — same $5/$25 pricing, native 1M context window, 128K max output, and native `xhigh` effort level. The wire-format transforms Mux added for Opus 4.7 (xhigh override header + adaptive thinking `display: "summarized"`) already match 4.7+ via regex, so this change is mostly a model-id bump. - knownModels.ts: OPUS now resolves to `claude-opus-4-8` (alias `opus`, default model). Tokenizer override stays on Opus 4.5 since the upstream tokenizer hasn't shipped a 4.6+ encoding and tokenization is unchanged across the 4.x line. - models-extra.ts: new `claude-opus-4-8` pricing/capability entry (same shape as 4.7). - models.ts: added `claude-opus-4-8` to ANTHROPIC_NATIVE_1M_PATTERNS. - providerService.ts: first-time mux-gateway default model set now seeds `anthropic/claude-opus-4-8`. - Workflows (auto-cleanup, auto-cleanup-fixup, terminal-bench, nightly-terminal-bench): updated default Opus reference. - Tests updated for the new default (cli/run.test.ts, providerService.test.ts, slashCommands.spec.ts). - Regenerated docs (`docs/config/models.mdx`, `docs/guides/github-actions.mdx`) and built-in skill content. --- _Generated with `mux` • Model: `anthropic:claude-opus-4-7` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-opus-4-7 thinking=xhigh -->
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87a34f03f8
ℹ️ 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 The earlier finding was based on stale documentation. Opus 4.8 launched today (May 28, 2026) — see https://www.anthropic.com/news/claude-opus-4-8 (announcement) and https://platform.claude.com/docs/en/about-claude/models/overview (now lists |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
@codex review Just pushed |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ 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 Completes the Claude Opus 4.8 rollout on top of the upstream default-model bump by adding the remaining metadata, examples, and regression coverage that mirror the previous Opus upgrade pattern. ## Background `main` now includes the core Claude Opus 4.8 default-model update from coder#3409. After rebasing this branch onto `main`, this PR is the follow-up diff: Terminal-Bench leaderboard metadata, story/test fixtures, model-routing examples, and explicit Opus 4.8 coverage around native 1M/xhigh behavior. ## Implementation - Adds `anthropic/claude-opus-4-8` to Terminal-Bench leaderboard submission metadata and examples. - Updates the Models settings story fixture to use Opus 4.8. - Updates routing/example comments and Opus 4.7+ thinking/provider comments to describe the forward-compatible behavior accurately. - Adds explicit Opus 4.8 assertions for native 1M context, xhigh effort override, and Anthropic wire transforms. - Table-drives duplicated Opus 4.7/4.8 wire-transform test setup from the simplify/deslop pass. ## Validation - `bun test src/common/constants/knownModels.test.ts src/common/utils/ai/models.test.ts src/common/utils/ai/providerOptions.test.ts src/node/services/providerModelFactory.test.ts src/browser/hooks/useModelsFromSettings.test.ts` - `make static-check` - `git diff --check` ## Risks Low risk: the default model bump itself is already on `main`; this PR only fills in surrounding metadata, examples, and tests. Runtime changes are limited to comments and test coverage, with no behavior change beyond leaderboard metadata availability. --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$13.05`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=13.05 -->
Summary
Adds first-class support for Claude Opus 4.8 (released May 28, 2026) and promotes it to Mux's default
opus/OPUSmodel in place of Opus 4.7.Background
Anthropic shipped Opus 4.8 today as a same-shape successor to Opus 4.7:
effortdefaults tohigh;xhighandmaxremain distinct API effort values.claude-opus-4-8(dateless, pinned snapshot — same convention as 4.6/4.7).Mux already routes Opus 4.7+ through the right wire-format transforms via regex (
anthropicSupportsNativeXhigh()matchesclaude-opus-4-(?:[7-9]|\d{2,})), so the xhigh effort header rewrite andthinking.display: "summarized"injection apply to 4.8 automatically. This PR is therefore mostly a model-id bump plus new pricing metadata.Implementation
Model registry & pricing
knownModels.ts:OPUS→claude-opus-4-8(aliasopus, default model). Tokenizer override stays onanthropic/claude-opus-4.5since the upstream tokenizer hasn't published a newer encoding and tokenization is unchanged across the 4.x line.models-extra.ts: addedclaude-opus-4-8capability/pricing entry mirroring 4.7 (1M input, 128K output, full reasoning/vision/PDF/tool support).models.ts: addedclaude-opus-4-8toANTHROPIC_NATIVE_1M_PATTERNSso the context window is treated as native (not beta-gated).Defaults & seed data
providerService.ts: first-time mux-gateway seeding now listsanthropic/claude-opus-4-8(was 4-7).auto-cleanup,auto-cleanup-fixup,nightly-terminal-bench, andterminal-benchall reference the new default Opus ID.Tests & docs
cli/run.test.ts,providerService.test.ts,slashCommands.spec.tsPlaywright spec).docs/config/models.mdxanddocs/guides/github-actions.mdxviabun scripts/gen_docs.ts.builtInSkillContent.generated.ts.The existing
policy.test.tsandproviderOptions.test.tsalready contained "hypothetical Opus 4.8" guard tests that exercise the regex-based detectors — they pass unchanged and now exercise real production behaviour.Validation
make typecheckmake static-checkbun teston the touched suites:knownModels,models,modelDisplay,policy,providerOptions,providerService,cli/run,StreamingMessageAggregator.Risks
Low. The wire-format risk (
xhigheffort +summarizedthinking display) was paid down in #3180 by detecting Opus 4.7+ via regex rather than literal model IDs, so 4.8 inherits those code paths without any branch changes. Pricing is identical to 4.7. The main user-visible effect is that anyone on theopusalias automatically routes to the new model — which is the intended behaviour.Generated with
mux• Model:anthropic:claude-opus-4-7• Thinking:xhigh