Skip to content

feat(anthropic): add Claude Opus 5 model support - #113391

Merged
fuller-stack-dev merged 2 commits into
mainfrom
feat/anthropic-claude-opus-5
Jul 24, 2026
Merged

fuller-stack-dev merged 2 commits into
mainfrom
feat/anthropic-claude-opus-5

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

What Problem This Solves

Anthropic released Claude Opus 5 (claude-opus-5; GA on the Claude API, Bedrock, Vertex, and Claude Platform on AWS). OpenClaw had no support for it: the model was absent from every catalog surface, and — worse — the Claude model contracts treated an unknown claude-* id as a pre-4.6 model, so a hand-configured anthropic/claude-opus-5 produced invalid requests:

  • supportsClaudeAdaptiveThinking() did not match claude-opus-5, so thinking-enabled requests were shaped as thinking: {type: "enabled", budget_tokens: N} — rejected with a 400 by the API (Opus 5 is adaptive-only).
  • requiresClaudeDefaultSampling() was false, so temperature/top_p/top_k were not stripped — also a 400 on Opus 5.
  • No xhigh/max effort mapping, no catalog metadata (context window fell back to 200k instead of the model-default 1M, no pricing, no picker entry).

Why This Change Was Made

Wires claude-opus-5 through the same contract seams Sonnet 5 uses, since Opus 5 shares its API surface (per Anthropic's migration guide, docs/en/about-claude/models/migration-guide → "Migrating from Claude Opus 4.8 to Claude Opus 5"):

  • Contracts (packages/llm-core/src/model-contracts/anthropic.ts): new resolveClaudeOpus5ModelIdentity(); opus-5 added to the adaptive-thinking, native-max-effort, and native-xhigh-effort predicates (default-sampling rejection follows from xhigh). New CLAUDE_OPUS_5_THINKING_PROFILE (same shape as Sonnet 5: off–max + adaptive, default high — Opus 5 defaults thinking on but still allows disabling at effort ≤ high).
  • Request shaping (packages/ai): Opus 5 joins Sonnet 5 in adaptive-by-default thinking, assistant-prefill stripping (prepareClaudeSonnet5RequestContext generalized to prepareClaudeNoPrefillRequestContext), the streaming refusal contract (Opus 5 ships cyber safety classifiers), model-bound thinking replay (preserve same-model, drop cross-model), and the full-catalog max_tokens default (the 32k clamp starves thinking + response output on adaptive-default models).
  • Catalogs: anthropic + claude-cli entries in the plugin manifest ($5/$25 per MTok, 0.5/6.25 cache, 1M context, 128k output, 2576px images, xhigh/max map), CLI catalog/labels/allowlist/aliases, Vertex provider catalog, Bedrock context-window/max-tokens/input maps and thinking policy, Mantle request shaping, core context resolution (1M is the Opus 5 model default — no [1m] opt-in), live-model priority list, and model-id normalization (opus-5 alias).
  • Docs: docs/providers/anthropic.md thinking-defaults section.

Deliberately not changed (product decisions / unknowns, called out for review):

  • The bare opus family alias still resolves to claude-opus-4-8, and the Claude CLI default model stays claude-opus-4-8. Flipping those defaults affects existing configs and deserves an explicit call.
  • Priority Tier (service_tier) is left enabled for Opus 5 (treated like Opus 4.8); Anthropic documents the omission only for Sonnet 5. If live traffic shows Opus 5 rejects it, the Sonnet 5 carve-out extends trivially.
  • Fast mode stays Opus 4.8/4.7-only.
  • The new server-side-fallback-2026-07-01 / fallbacks: "default" beta and the Fable→Opus fallback pin (claude-opus-4-8) are untouched; retargeting the Fable refusal fallback to Opus 5 is a follow-up once allowed_fallback_models confirms it.

User Impact

anthropic/claude-opus-5 (and claude-cli/claude-opus-5, Vertex, Bedrock, Mantle) now works end to end: correct adaptive-thinking/effort request shaping, sampling params stripped, prefills stripped, refusal-safe streaming, 1M context / 128k output metadata, pricing, and picker/allowlist visibility. Opus 5 is seeded into the default Claude CLI allowlist, so openclaw doctor/setup migrations add the routing entry for existing CLI users.

Evidence

  • Focused local tests (all green): src/plugin-sdk/provider-model-shared.test.ts, extensions/anthropic (11 files / 223 tests), extensions/amazon-bedrock, extensions/anthropic-vertex, extensions/amazon-bedrock-mantle, packages/llm-core, packages/agent-core, packages/model-catalog-core, packages/ai anthropic provider + transport tests, src/agents/context.test.ts, wizard suites.
  • New regression coverage: Opus 5 predicate/profile assertions, exact manifest contract test (mirrors the Sonnet 5 one), CLI catalog metadata test, context-window rows for all three Anthropic providers, boundary assertions (claude-opus-50 is not Opus 5).
  • Remote delegated check:changed (typecheck/lint fan-out) via Blacksmith Testbox: tbx_01kyaq8tw3tb6hfs26ttfyagt8, runStatus succeeded, exit 0.
  • $autoreview (Codex gpt-5.6-sol, high): clean — no accepted/actionable findings; "patch is correct (0.98)".
  • Contract facts verified against Anthropic's live docs (models overview + Opus 5 migration guide): adaptive-on-by-default; thinking: disabled allowed only at effort ≤ high; budget_tokens and non-default sampling params rejected; prefill rejected; effort low–max incl. xhigh; 1M context default; 128k output; $5/$25 pricing; cyber safety classifiers with stop_reason: "refusal".

🤖 Generated with Claude Code

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling extensions: anthropic extensions: amazon-bedrock extensions: anthropic-vertex size: M maintainer Maintainer-authored PR labels Jul 24, 2026
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review July 24, 2026 19:57
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 24, 2026
@clawsweeper

clawsweeper Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed July 24, 2026, 4:03 PM ET / 20:03 UTC.

ClawSweeper review

What this changes

This PR adds Claude Opus 5 model support across Anthropic API, Claude CLI, Vertex, Bedrock, Mantle, and agent catalog/context paths, including model-specific thinking and request-shaping behavior.

Merge readiness

⛔ Blocked by patch quality or review findings - 5 items remain

Keep this PR open for a focused repair: its new Anthropic Vertex catalog row does not extend the existing explicit-model normalizer, so configured Vertex Opus 5 rows can miss the metadata and thinking contract the PR promises. Likely related people: fuller-stack-dev is the member contributor for this provider change (high confidence).

Priority: P2
Reviewed head: 6f414170ff79107fc45b67fcc50b1a170d12d1eb

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is broad and well-scoped, but the missing explicit Vertex normalization path leaves a concrete provider behavior gap.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a member-authored, maintainer-labeled PR, so external-contributor real-behavior proof is not a gate; the remaining blocker is a source-confirmed functional omission.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a member-authored, maintainer-labeled PR, so external-contributor real-behavior proof is not a gate; the remaining blocker is a source-confirmed functional omission.
Evidence reviewed 4 items Vertex catalog is only half of the provider path: The proposed claude-opus-5 Vertex catalog row is added, but the same module's existing explicit-model normalizer recognizes only Fable 5, Mythos 5, and Sonnet 5. A user-supplied Vertex Opus 5 row therefore bypasses restoration of reasoning, image input, 1M context, 128K output, and the native thinking map.
Current-main sibling behavior: Current main uses normalizeAnthropicVertexResolvedModel to restore Claude 5 metadata for explicit Vertex catalog rows, with model-family checks for Fable 5, Mythos 5, and Sonnet 5 only; Opus 5 needs the same owner-path treatment rather than static catalog support alone.
PR scope and protected review state: The PR is an open, maintainer-labeled member contribution that changes provider contracts, catalogs, CLI setup migration defaults, and docs; protected-item policy requires explicit maintainer handling rather than automated closure.
Findings 1 actionable finding [P1] Normalize explicit Vertex Opus 5 model rows
Security None None.

How this fits together

Shared Claude model contracts determine model capabilities such as thinking levels, token limits, and sampling rules. Provider plugins use those contracts to build catalog entries and normalize user-configured models before request transports call Anthropic, Vertex, Bedrock, or CLI backends.

flowchart LR
  A[Selected Claude model] --> B[Shared Claude contracts]
  B --> C[Provider catalog]
  B --> D[Configured model normalization]
  C --> E[Agent model selection]
  D --> F[Provider request shaping]
  E --> F
  F --> G[Anthropic, Vertex, Bedrock, or CLI]
Loading

Before merge

  • Normalize explicit Vertex Opus 5 model rows (P1) - Add resolveClaudeOpus5ModelIdentity() to normalizeAnthropicVertexResolvedModel. This patch only publishes the static catalog entry, while explicit anthropic-vertex model overrides still miss the normalizer that restores Claude 5 reasoning, image input, 1M/128K limits, and native thinking levels; those users can therefore get the incomplete pre-contract behavior the PR aims to fix.
  • Resolve merge risk (P1) - Configured anthropic-vertex Opus 5 models can retain incomplete metadata and an incorrect thinking contract because the explicit-model normalization path is not updated alongside the static catalog.
  • Resolve merge risk (P1) - Claude CLI setup now seeds one additional persisted model-routing entry for existing users; the migration behavior needs to remain additive and preserve existing runtime choices.
  • Improve patch quality - Add Opus 5 to Vertex configured-model normalization and a focused explicit-row regression test.
  • Improve patch quality - Capture or link a redacted Vertex runtime proof after the repair if credentials and a supported endpoint are available.

Findings

  • [P1] Normalize explicit Vertex Opus 5 model rows — extensions/anthropic-vertex/provider-catalog.ts:114
Agent review details

Security

None.

PR surface

Source +134, Tests +64, Docs +8. Total +206 across 29 files.

View PR surface stats
Area Files Added Removed Net
Source 22 182 48 +134
Tests 6 65 1 +64
Docs 1 9 1 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 29 256 50 +206

Review metrics

Metric Value Why it matters
CLI migration allowlist 1 added default allowlist entry Existing Claude CLI setup migrations will write an additional anthropic/claude-opus-5 runtime-policy entry, so additive upgrade behavior needs review.

Stored data model

Persistent data-model change detected: vector/embedding metadata: extensions/anthropic/index.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Normalize explicit Vertex Opus 5 models (recommended)
    Add Opus 5 to the Anthropic Vertex explicit-model normalization path and cover a configured row so it receives the catalog contract before merge.
  2. Narrow the advertised Vertex support
    If explicit Vertex model overrides are intentionally unsupported, remove or clearly limit the Opus 5 Vertex claim instead of publishing a partial provider contract.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Extend the Vertex configured-model normalizer and focused regression test for Claude Opus 5; preserve existing model defaults and aliases.

Technical review

Best possible solution:

Extend the Vertex explicit-model normalizer and its focused tests so catalog-provided and user-configured Opus 5 rows receive the same complete contract, then retain the additive CLI allowlist migration without changing the existing default model.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: configure an explicit anthropic-vertex model row for claude-opus-5; the current normalizer's family checks do not match it, unlike the sibling Fable, Mythos, and Sonnet 5 paths.

Is this the best way to solve the issue?

No; the static Vertex catalog addition is not the best complete fix because explicit configured Vertex rows pass through a sibling normalization boundary that the PR does not update.

Full review comments:

  • [P1] Normalize explicit Vertex Opus 5 model rows — extensions/anthropic-vertex/provider-catalog.ts:114
    Add resolveClaudeOpus5ModelIdentity() to normalizeAnthropicVertexResolvedModel. This patch only publishes the static catalog entry, while explicit anthropic-vertex model overrides still miss the normalizer that restores Claude 5 reasoning, image input, 1M/128K limits, and native thinking levels; those users can therefore get the incomplete pre-contract behavior the PR aims to fix.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2900026b333d.

Labels

Label changes:

  • add P2: This is a normal-priority provider capability addition with a concrete configured-model behavior gap.
  • add merge-risk: 🚨 compatibility: The change adds persisted CLI migration output and leaves explicit Vertex Opus 5 configurations without the normalization contract applied to sibling Claude 5 models.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This is a member-authored, maintainer-labeled PR, so external-contributor real-behavior proof is not a gate; the remaining blocker is a source-confirmed functional omission.

Label justifications:

  • P2: This is a normal-priority provider capability addition with a concrete configured-model behavior gap.
  • merge-risk: 🚨 compatibility: The change adds persisted CLI migration output and leaves explicit Vertex Opus 5 configurations without the normalization contract applied to sibling Claude 5 models.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This is a member-authored, maintainer-labeled PR, so external-contributor real-behavior proof is not a gate; the remaining blocker is a source-confirmed functional omission.

Evidence

What I checked:

  • Vertex catalog is only half of the provider path: The proposed claude-opus-5 Vertex catalog row is added, but the same module's existing explicit-model normalizer recognizes only Fable 5, Mythos 5, and Sonnet 5. A user-supplied Vertex Opus 5 row therefore bypasses restoration of reasoning, image input, 1M context, 128K output, and the native thinking map. (extensions/anthropic-vertex/provider-catalog.ts:114, 6f414170ff79)
  • Current-main sibling behavior: Current main uses normalizeAnthropicVertexResolvedModel to restore Claude 5 metadata for explicit Vertex catalog rows, with model-family checks for Fable 5, Mythos 5, and Sonnet 5 only; Opus 5 needs the same owner-path treatment rather than static catalog support alone. (extensions/anthropic-vertex/provider-catalog.ts:4, 2900026b333d)
  • PR scope and protected review state: The PR is an open, maintainer-labeled member contribution that changes provider contracts, catalogs, CLI setup migration defaults, and docs; protected-item policy requires explicit maintainer handling rather than automated closure. (6f414170ff79)
  • Security and supply-chain pass: The diff changes provider code, manifests, tests, and documentation only; it adds no dependency, workflow, package-install, secret, or artifact-execution surface. (6f414170ff79)

Likely related people:

  • fuller-stack-dev: The PR is authored by this repository member and the maintainer label identifies the contribution as a maintainer-owned review item; the available review context ties the implementation directly to the Anthropic provider surfaces. (role: member contributor for the current provider-model implementation; confidence: high; commits: 6f414170ff79; files: packages/llm-core/src/model-contracts/anthropic.ts, extensions/anthropic-vertex/provider-catalog.ts, extensions/anthropic/openclaw.plugin.json)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

fuller-stack-dev and others added 2 commits July 24, 2026 14:35
Wire claude-opus-5 through the Claude 5 contract seams: adaptive-by-default
thinking with the full low..max effort range, default-sampling and prefill
stripping, streaming refusal contract, model-bound thinking replay, and 1M/128k
catalog metadata across anthropic, claude-cli, Vertex, Bedrock, and Mantle.

Co-Authored-By: Claude Fable 5 <[email protected]>
Extend normalizeAnthropicVertexResolvedModel so user-configured Vertex Opus 5
rows regain reasoning, image input, 1M/128k limits, and the native thinking
map; update the live-model priority expectation and regenerate docs_map.

Co-Authored-By: Claude Fable 5 <[email protected]>
@fuller-stack-dev
fuller-stack-dev force-pushed the feat/anthropic-claude-opus-5 branch from 6f41417 to fb3644c Compare July 24, 2026 20:35
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Applied ClawSweeper's rank-up moves in fb3644c:

  • Normalize explicit Vertex Opus 5 model rows (P1) — normalizeAnthropicVertexResolvedModel now resolves resolveClaudeOpus5ModelIdentity(), so configured anthropic-vertex Opus 5 rows regain reasoning, image input, 1M context / 128k output, and the native xhigh/max thinking map (no off/minimal remap — Opus 5 keeps thinking disableable at effort ≤ high). Focused regression test added ("restores Opus 5 metadata for explicit Vertex catalog rows"), including an assertion that off is not remapped.
  • CLI seeding stays additive — buildAnthropicCliMigrationResult only merges a routing entry (agentRuntime.id: "claude-cli") for allowlist models and preserves existing model entries (aliases, primary/fallback selection untouched); covered by the existing cli-migration.test.ts cases updated in this PR ("keeps anthropic defaults and selects the claude-cli runtime").
  • Vertex runtime proof — skipped: no GCP Vertex credentials available in this environment. The explicit-row regression test plus the shared identity contract (same code path Sonnet 5/Fable 5 use in production on Vertex) is the offered proof; happy to attach a redacted live run if someone with Vertex access wants to exercise it before or after merge.

Also fixed on the same push: the stale generated docs/docs_map.md (heading change in docs/providers/anthropic.md) and the listPrioritizedHighSignalLiveModelRefs expectation — both were the red checks on the previous head.

@fuller-stack-dev
fuller-stack-dev merged commit 2ee8730 into main Jul 24, 2026
118 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the feat/anthropic-claude-opus-5 branch July 24, 2026 20:47
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 25, 2026
* feat(anthropic): add Claude Opus 5 model support

Wire claude-opus-5 through the Claude 5 contract seams: adaptive-by-default
thinking with the full low..max effort range, default-sampling and prefill
stripping, streaming refusal contract, model-bound thinking replay, and 1M/128k
catalog metadata across anthropic, claude-cli, Vertex, Bedrock, and Mantle.

Co-Authored-By: Claude Fable 5 <[email protected]>

* fix(anthropic-vertex): normalize explicit Vertex Opus 5 model rows

Extend normalizeAnthropicVertexResolvedModel so user-configured Vertex Opus 5
rows regain reasoning, image input, 1M/128k limits, and the native thinking
map; update the live-model priority expectation and regenerate docs_map.

Co-Authored-By: Claude Fable 5 <[email protected]>

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation extensions: amazon-bedrock extensions: anthropic extensions: anthropic-vertex maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant