Skip to content

🤖 feat: add support for Claude Opus 4.8#3409

Merged
ammario merged 2 commits into
mainfrom
feat/opus-4-8-support
May 28, 2026
Merged

🤖 feat: add support for Claude Opus 4.8#3409
ammario merged 2 commits into
mainfrom
feat/opus-4-8-support

Conversation

@ammar-agent

Copy link
Copy Markdown
Collaborator

Summary

Adds first-class support for Claude Opus 4.8 (released May 28, 2026) and promotes it to Mux's default opus/OPUS model in place of Opus 4.7.

Background

Anthropic shipped Opus 4.8 today as a same-shape successor to Opus 4.7:

  • Identical pricing: $5 / $25 per million input/output tokens (cache write $6.25, cache read $0.50).
  • Identical envelope: native 1M context window, 128K max output.
  • Same effort/thinking surface: effort defaults to high; xhigh and max remain distinct API effort values.
  • API ID: 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() matches claude-opus-4-(?:[7-9]|\d{2,})), so the xhigh effort header rewrite and thinking.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: OPUSclaude-opus-4-8 (alias opus, default model). Tokenizer override stays on anthropic/claude-opus-4.5 since the upstream tokenizer hasn't published a newer encoding and tokenization is unchanged across the 4.x line.
  • models-extra.ts: added claude-opus-4-8 capability/pricing entry mirroring 4.7 (1M input, 128K output, full reasoning/vision/PDF/tool support).
  • models.ts: added claude-opus-4-8 to ANTHROPIC_NATIVE_1M_PATTERNS so the context window is treated as native (not beta-gated).

Defaults & seed data

  • providerService.ts: first-time mux-gateway seeding now lists anthropic/claude-opus-4-8 (was 4-7).
  • CI workflows: auto-cleanup, auto-cleanup-fixup, nightly-terminal-bench, and terminal-bench all reference the new default Opus ID.

Tests & docs

  • Updated assertions that pinned the Opus 4.7 default (cli/run.test.ts, providerService.test.ts, slashCommands.spec.ts Playwright spec).
  • Regenerated docs/config/models.mdx and docs/guides/github-actions.mdx via bun scripts/gen_docs.ts.
  • Regenerated builtInSkillContent.generated.ts.

The existing policy.test.ts and providerOptions.test.ts already contained "hypothetical Opus 4.8" guard tests that exercise the regex-based detectors — they pass unchanged and now exercise real production behaviour.

Validation

  • make typecheck
  • make static-check
  • bun test on the touched suites: knownModels, models, modelDisplay, policy, providerOptions, providerService, cli/run, StreamingMessageAggregator.

Risks

Low. The wire-format risk (xhigh effort + summarized thinking 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 the opus alias automatically routes to the new model — which is the intended behaviour.


Generated with mux • Model: anthropic:claude-opus-4-7 • Thinking: xhigh

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 -->
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/common/constants/knownModels.ts
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@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 claude-opus-4-8 as the latest Opus tier with same $5/$25 pricing as 4.7). Please take another look.

@mintlify

mintlify Bot commented May 28, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Mux 🟢 Ready View Preview May 28, 2026, 5:20 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Just pushed 9dad131d5 updating two test fixtures (useModelsFromSettings.test.ts and useCreationWorkspace.test.tsx) that pinned the old Opus 4.7 ID. The original concern about claude-opus-4-8 being unpublished was based on stale docs — Anthropic launched Opus 4.8 today (https://www.anthropic.com/news/claude-opus-4-8), the model ID is live on the Claude API, and pricing is unchanged from 4.7.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ 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".

@ammario ammario merged commit 882b39c into main May 28, 2026
24 checks passed
@ammario ammario deleted the feat/opus-4-8-support branch May 28, 2026 18:48
PamelaSprin47685ghall pushed a commit to PamelaSprin47685ghall/mux that referenced this pull request May 31, 2026
## 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
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants