Repository navigation
feat(anthropic): add Claude Opus 5 model support - #113391
Conversation
|
Codex review: found issues before merge. Reviewed July 24, 2026, 4:03 PM ET / 20:03 UTC. ClawSweeper reviewWhat this changesThis 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 Review scores
Verification
How this fits togetherShared 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]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +134, Tests +64, Docs +8. Total +206 across 29 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest 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 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2900026b333d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
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]>
6f41417 to
fb3644c
Compare
|
Applied ClawSweeper's rank-up moves in fb3644c:
Also fixed on the same push: the stale generated |
|
Merged via squash.
|
* 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]>
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 unknownclaude-*id as a pre-4.6 model, so a hand-configuredanthropic/claude-opus-5produced invalid requests:supportsClaudeAdaptiveThinking()did not matchclaude-opus-5, so thinking-enabled requests were shaped asthinking: {type: "enabled", budget_tokens: N}— rejected with a 400 by the API (Opus 5 is adaptive-only).requiresClaudeDefaultSampling()was false, sotemperature/top_p/top_kwere not stripped — also a 400 on Opus 5.xhigh/maxeffort 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-5through 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"):packages/llm-core/src/model-contracts/anthropic.ts): newresolveClaudeOpus5ModelIdentity();opus-5added to the adaptive-thinking, native-max-effort, and native-xhigh-effort predicates (default-sampling rejection follows from xhigh). NewCLAUDE_OPUS_5_THINKING_PROFILE(same shape as Sonnet 5:off–max+adaptive, defaulthigh— Opus 5 defaults thinking on but still allows disabling at effort ≤high).packages/ai): Opus 5 joins Sonnet 5 in adaptive-by-default thinking, assistant-prefill stripping (prepareClaudeSonnet5RequestContextgeneralized toprepareClaudeNoPrefillRequestContext), the streaming refusal contract (Opus 5 ships cyber safety classifiers), model-bound thinking replay (preserve same-model, drop cross-model), and the full-catalogmax_tokensdefault (the 32k clamp starves thinking + response output on adaptive-default models).anthropic+claude-clientries in the plugin manifest ($5/$25 per MTok, 0.5/6.25 cache, 1M context, 128k output, 2576px images,xhigh/maxmap), 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-5alias).docs/providers/anthropic.mdthinking-defaults section.Deliberately not changed (product decisions / unknowns, called out for review):
opusfamily alias still resolves toclaude-opus-4-8, and the Claude CLI default model staysclaude-opus-4-8. Flipping those defaults affects existing configs and deserves an explicit call.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.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 onceallowed_fallback_modelsconfirms it.User Impact
anthropic/claude-opus-5(andclaude-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, soopenclaw doctor/setup migrations add the routing entry for existing CLI users.Evidence
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/aianthropic provider + transport tests,src/agents/context.test.ts, wizard suites.claude-opus-50is not Opus 5).check:changed(typecheck/lint fan-out) via Blacksmith Testbox:tbx_01kyaq8tw3tb6hfs26ttfyagt8, runStatus succeeded, exit 0.$autoreview(Codexgpt-5.6-sol, high): clean — no accepted/actionable findings; "patch is correct (0.98)".thinking: disabledallowed only at effort ≤ high;budget_tokensand non-default sampling params rejected; prefill rejected; effortlow–maxincl.xhigh; 1M context default; 128k output; $5/$25 pricing; cyber safety classifiers withstop_reason: "refusal".🤖 Generated with Claude Code