Skip to content

fix(anthropic): expose native effort ladder for mandatory-adaptive Claude 5 on claude-cli - #102355

Closed
ryuhaneul wants to merge 1 commit into
openclaw:mainfrom
ryuhaneul:fix/claude-cli-mandatory-thinking
Closed

ryuhaneul wants to merge 1 commit into
openclaw:mainfrom
ryuhaneul:fix/claude-cli-mandatory-thinking

Conversation

@ryuhaneul

@ryuhaneul ryuhaneul commented Jul 9, 2026 •

Copy link
Copy Markdown

Related: #101453

What Problem This Solves

Fixes an issue where users running Claude Fable 5 or Claude Mythos 5 through the claude-cli backend would only see off in the thinking-level menu (/think), with no low/medium/high/xhigh/max selectable — while the same models on the native anthropic provider expose the full effort ladder. Effort control was silently unavailable for subscription (Claude Code CLI) users on these models.

Why This Change Was Made

The off-only profile (CLAUDE_CLI_OFF_THINKING_PROFILE) is an opt-out for "Claude CLI routes unsupported by Claude Code" — but the claude-cli backend is Claude Code, which honors --effort for mandatory-adaptive Claude 5 models, and the backend already maps every thinking level onto --effort (mapClaudeCliThinkingLevelToEffort). This PR exempts CLAUDE_CLI_BACKEND_ID from the off-lock in the two places that resolve thinking profiles (the runtime resolveThinkingProfile hook and the lightweight provider-policy path), mirroring how includeNativeMax in the same resolver already treats claude-cli as native-capable. Non-goal: all other providers (Bedrock, Vertex, OpenRouter, …) keep the off-lock unchanged.

User Impact

Users on the claude-cli backend can now select every effort level for Fable 5 and Mythos 5 (default high), matching the native Anthropic API experience. No configuration changes required.

Evidence

Claude Code CLI 2.1.202 honors --effort for claude-fable-5 at every level (subscription OAuth):

$ claude --model claude-fable-5 --effort high  -p "Reply with exactly one word: pong"  → pong  [exit 0]
$ claude --model claude-fable-5 --effort max   -p "..."                                 → pong  [exit 0]
$ claude --model claude-fable-5 --effort xhigh -p "..."                                 → pong  [exit 0]
$ claude --model claude-fable-5 --effort low   -p "..."                                 → pong  [exit 0]

$ claude --model claude-fable-5 --effort banana -p "ping"
Warning: Unknown --effort value 'banana' — ignoring it and using the default effort.
Valid values: low, medium, high, xhigh, max.

So the off-lock's compatibility premise no longer holds for the CLI route. (Mythos 5 was not directly testable — invite-gated — but it rides the identical CLI --effort mechanism.)

Local validation on this branch:

  • vitest run extensions/anthropic/provider-policy-api.test.ts extensions/anthropic/index.test.ts — 49/49 passed (updated expectations included)
  • oxfmt --check and oxlint clean on all touched files

🤖 Generated with Claude Code

…aude 5 on claude-cli

The claude-cli backend shells out to Claude Code itself, which honors
--effort for mandatory-adaptive Claude 5 models (verified on Claude Code
2.1.202 with claude-fable-5: low/medium/high/xhigh/max all accepted and
validated). The off-only thinking profile guards "Claude CLI routes
unsupported by Claude Code", which cannot apply to Claude Code itself --
and the same resolver already treats claude-cli as native via
includeNativeMax.

Exempt CLAUDE_CLI_BACKEND_ID from the off-lock in both the runtime
resolveThinkingProfile hook and the lightweight provider-policy path, and
update tests to expect the full ladder on claude-cli. Other providers
(Bedrock, Vertex, OpenRouter, ...) keep the off-lock.

Co-Authored-By: Claude Fable 5 <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added extensions: anthropic size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 9, 2026
@clawsweeper

clawsweeper Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 8, 2026, 10:54 PM ET / 02:54 UTC.

Summary
The PR changes the Anthropic provider runtime and lightweight provider-policy API so claude-cli Fable/Mythos use the native Claude thinking ladder with updated regression tests.

PR surface: Source -6, Tests +30. Total +24 across 4 files.

Reproducibility: yes. Current-main source inspection shows both the runtime hook and lightweight provider-policy hook return the off-only profile for claude-cli Fable/Mythos before this PR.

Review metrics: 1 noteworthy metric.

  • Thinking-profile defaults changed: 2 model families changed from off-only/off to full ladder/high. This is the compatibility-sensitive behavior shift that unit tests and green CI do not decide by themselves.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] Merging intentionally changes existing claude-cli Fable/Mythos thinking controls from off-only/off default to the full ladder with high default, so maintainers should explicitly accept the upgrade behavior.
  • [P1] The PR body includes live Fable CLI proof, while Mythos live CLI proof is inferred from the same Claude Code effort mechanism and shared model-family path.
  • [P1] The PR is mergeable but behind the current base, so exact-head CI or merge-result review should still gate landing.

Maintainer options:

  1. Accept the CLI route correction (recommended)
    Land once exact-head CI is acceptable, owning the intentional change from off-only to native high/default effort for claude-cli Fable/Mythos.
  2. Narrow the default before merge
    Preserve the full ladder but make the claude-cli default more conservative if maintainers want to avoid a default-effort upgrade shift.
  3. Pause pending direct Mythos proof
    Hold or split the Mythos behavior until a maintainer or contributor with access verifies the same Claude CLI effort path.

Next step before merge

  • [P2] No automation repair is queued; the remaining action is maintainer acceptance of the compatibility/default change plus normal exact-head CI review.

Maintainer decision needed

  • Question: Should claude-cli Fable/Mythos inherit the direct Anthropic full thinking ladder with high default for existing sessions?
  • Rationale: The code change is narrow and consistent, but it changes supported thinking levels and the provider default for upgraded Claude CLI sessions, and Mythos proof is inferred rather than directly run.
  • Likely owner: steipete — Peter has the strongest feature-history signal for Fable 5 adaptive thinking and shared Claude thinking-profile behavior.
  • Options:
    • Accept corrected CLI profile (recommended): Land after exact-head CI review, accepting that Claude CLI Fable/Mythos sessions move from off-only to native effort selection with high default.
    • Expose ladder with conservative default: Keep the new selectable levels but adjust the default if maintainers want upgraded sessions to avoid a default-effort increase.
    • Pause for direct Mythos proof: Hold or narrow the Mythos portion until someone with access verifies the same effort ladder live.

Security
Cleared: The diff only changes Anthropic provider thinking-policy code and tests; it does not touch secrets, dependencies, workflows, install scripts, package metadata, or downloaded code execution.

Review details

Best possible solution:

Keep the provider-owned fix in both thinking-policy surfaces, preserve the off-lock for non-Claude-Code routes, and land only after maintainers accept the default shift and coordinate with the related Claude CLI catalog work.

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

Yes. Current-main source inspection shows both the runtime hook and lightweight provider-policy hook return the off-only profile for claude-cli Fable/Mythos before this PR.

Is this the best way to solve the issue?

Yes, this is the best-shaped code fix because it updates both provider-owned policy surfaces that feed runtime and lightweight session policy. Updating only the CLI argv mapper or only one policy hook would leave UI/default validation drift.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 30b3a7cdeda9.

Label changes

Label justifications:

  • P2: This is a focused provider/backend bug fix with limited blast radius to Claude CLI thinking controls.
  • merge-risk: 🚨 compatibility: Existing claude-cli Fable/Mythos sessions would see a different supported thinking-level set and provider default after upgrade.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes terminal output from a real Claude Code 2.1.202 run showing claude-fable-5 accepts multiple --effort levels and returns successfully; Mythos is disclosed as inferred from the same mechanism.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes terminal output from a real Claude Code 2.1.202 run showing claude-fable-5 accepts multiple --effort levels and returns successfully; Mythos is disclosed as inferred from the same mechanism.
Evidence reviewed

PR surface:

Source -6, Tests +30. Total +24 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 7 13 -6
Tests 2 36 6 +30
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 43 19 +24

What I checked:

  • Repository policy applied: Root and scoped extension policy were read; their provider-routing, plugin-owned policy, and compatibility-default guidance apply because this PR changes an Anthropic bundled plugin policy surface. (AGENTS.md:14, 30b3a7cdeda9)
  • Current main runtime behavior: Current main returns CLAUDE_CLI_OFF_THINKING_PROFILE for mandatory Claude 5 models whenever the provider is not direct anthropic, so claude-cli Fable/Mythos are off-only before this PR. (extensions/anthropic/register.runtime.ts:903, 30b3a7cdeda9)
  • Current main lightweight policy behavior: The lightweight provider-policy artifact has the same claude-cli Fable/Mythos off-only branch, so both policy surfaces need to change together to avoid runtime/UI drift. (extensions/anthropic/provider-policy-api.ts:43, 30b3a7cdeda9)
  • Existing CLI effort plumbing: The Claude CLI backend already maps OpenClaw thinking levels to Claude Code --effort values for normal execution. (extensions/anthropic/cli-shared.ts:208, 30b3a7cdeda9)
  • Shared mandatory profile: The shared Claude model contract defines Fable/Mythos mandatory-adaptive levels with high default and preserveWhenCatalogReasoningFalse, matching the PR's expected profile. (packages/llm-core/src/model-contracts/anthropic.ts:18, 30b3a7cdeda9)
  • External Claude Code contract: Anthropic's current Claude Code CLI reference documents --effort and the supported effort values, and the model configuration docs state Fable 5 defaults to high effort. (docs.anthropic.com)

Likely related people:

  • steipete: Authored the merged Claude Fable 5 adaptive thinking support and earlier shared Claude thinking-profile work that this PR relies on. (role: feature-history owner; confidence: high; commits: 0e7b5c34292c, f6bda8d36b7b; files: extensions/anthropic/register.runtime.ts, src/plugins/provider-claude-thinking.ts, packages/llm-core/src/model-contracts/anthropic.ts)
  • vincentkoc: Current blame and recent commits cover the Anthropic provider-policy and Mythos/Fable model-policy area touched by this PR. (role: recent area contributor; confidence: high; commits: 6f6c3e260222, f305e707a359, 45663f287937; files: extensions/anthropic/register.runtime.ts, extensions/anthropic/provider-policy-api.ts, extensions/anthropic/cli-shared.ts)
  • stainlu: Authored the merged change that made Claude CLI non-off thinking levels translate into Claude Code --effort, which is the execution path exposed here. (role: introduced related CLI effort plumbing; confidence: medium; commits: 74ab62c6a297; files: extensions/anthropic/cli-shared.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (3 earlier review cycles)
  • reviewed 2026-07-09T02:24:30.702Z sha b4339c0 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-09T02:32:07.245Z sha b4339c0 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-09T02:46:43.632Z sha b4339c0 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 9, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 9, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 24, 2026
@ryuhaneul

Copy link
Copy Markdown
Author

Closing: upstream already resolved the Fable 5 case.

provider-policy-api.ts now scopes the claude-cli off-lock to Mythos 5 only (with the comment "Claude Code exposes Fable's native effort ladder"), and the runtime hook narrowed its gate from isAnthropicMandatoryClaude5Model to isAnthropicMythos5Model. So Fable 5 on claude-cli gets the full effort ladder on current main, which was the point of this PR.

The only remaining delta is unlocking Mythos 5 as well, which I could not verify empirically (invite-gated), so I would rather not push it. Thanks!

@ryuhaneul ryuhaneul closed this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: anthropic merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S stale Marked as stale due to inactivity status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant