Skip to content

fix(llm): correctly handle reasoning=off in Anthropic and Google adapters#100938

Closed
aniruddhaadak80 wants to merge 2 commits into
openclaw:mainfrom
aniruddhaadak80:fix-simple-stream-options-reasoning
Closed

fix(llm): correctly handle reasoning=off in Anthropic and Google adapters#100938
aniruddhaadak80 wants to merge 2 commits into
openclaw:mainfrom
aniruddhaadak80:fix-simple-stream-options-reasoning

Conversation

@aniruddhaadak80

Copy link
Copy Markdown
Contributor

Fixes #100926

When users pass reasoning: "off" to SimpleStreamOptions, the adapters incorrectly evaluated it as truthy since "off" is a non-empty string. This PR explicitly checks for "off" to disable reasoning in the Anthropic and Google providers. For models with mandatory adaptive thinking (like Claude Fable 5), "off" now explicitly maps to "low" effort.

@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head c565c304c04441fa09e325ce8eedf5c8d60d3dfc, but the PR head is now b414d5fb8c7f1a622fe17e206412aa06414b2a86. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (1 earlier review cycle)
  • reviewed 2026-07-06T14:44:57.528Z sha 1fad2ff :: needs real behavior proof before merge. :: [P1] Retarget the fix to the live provider package

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 6, 2026
@aniruddhaadak80
aniruddhaadak80 force-pushed the fix-simple-stream-options-reasoning branch from 1fad2ff to c565c30 Compare July 6, 2026 14:46
@steipete steipete self-assigned this Jul 6, 2026
@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 6, 2026
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Thanks. After tracing the runtime contract, this patch targets a state the public provider API does not permit: SimpleStreamOptions.reasoning is ThinkingLevel, and ThinkingLevel excludes "off". User-facing off is normalized by agent-core to undefined or an explicit enabled fallback before provider dispatch. Exact-head CI's TS2367 errors are therefore correct.

The latest head also edits only Anthropic despite the PR title claiming Google; Fable 5's off-to-low result already matches its always-on adaptive contract. Closing rather than widening the plugin/provider API in a small fix. If OpenClaw should expose "off" directly through SimpleStreamOptions, that needs a separate API proposal and provider-wide audit and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: SimpleStreamOptions reasoning=off incorrectly enables thinking in Anthropic and Google providers

2 participants