Skip to content

(MOT-3929) fix(provider-anthropic): surface adaptive thinking by default on thinking-capable models - #462

Merged
andersonleal merged 3 commits into
mainfrom
andersonleal/mot-3929-provider-anthropic-surface-adaptive-thinking-by-default-on
Jul 9, 2026
Merged

(MOT-3929) fix(provider-anthropic): surface adaptive thinking by default on thinking-capable models#462
andersonleal merged 3 commits into
mainfrom
andersonleal/mot-3929-provider-anthropic-surface-adaptive-thinking-by-default-on

Conversation

@andersonleal

@andersonleal andersonleal commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • With no explicit thinking_level, provider-anthropic always sent config: None — thinking-capable models (Sonnet 4.6+, Opus 4.7+, Fable/Mythos 5) never got adaptive thinking unless the caller explicitly requested a level. provider-xai surfaces reasoning by default with no explicit level; this brings provider-anthropic to parity.
  • build_thinking_config now requests ADAPTIVE (server default effort, no output_config) when no level is given and the model's supports_thinking is explicitly Some(true). Unknown (None) or explicitly Some(false) models keep the old behavior, so the implicit default can never 400 a non-thinking or unknown model.
  • Cargo.lock churn across approval-gate/other providers is from the harness v1.1.12 bump (iii-sdk/iii-helpers version resolution), not a functional change.

Test plan

  • cargo test thinking in provider-anthropic (14 passed)
  • Updated/added unit tests: absent_level_defaults_on_for_thinking_models, absent_level_stays_off_without_thinking_support

https://linear.app/motia/issue/MOT-3929/provider-anthropic-surface-adaptive-thinking-by-default-on-thinking

Summary by CodeRabbit

  • Bug Fixes

    • Updated thinking settings so supported models now automatically use adaptive thinking when no level is specified.
    • Kept thinking turned off for models that do not support it or when support is unknown.
    • Ensured the default behavior preserves empty warnings and no extra effort settings when thinking is not enabled.
  • Tests

    • Added coverage for both supported and unsupported model cases to verify the new default behavior.

…ult on thinking-capable models

With no explicit thinking_level, build_thinking_config always returned
config: None, so thinking-capable models (Sonnet 4.6+, Opus 4.7+,
Fable/Mythos 5) never got adaptive reasoning unless the caller asked
for a level. provider-xai surfaces reasoning by default with no
explicit level; this brings provider-anthropic to parity.

Gated on supports_thinking == Some(true) specifically, so an unknown
or explicitly non-thinking model never gets the implicit default and
can't 400.

Cargo.lock churn across the other providers/approval-gate is from the
harness v1.1.12 bump (iii-sdk/iii-helpers version resolution).
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment Jul 9, 2026 4:30pm
workers-tech-spec Ready Ready Preview, Comment Jul 9, 2026 4:30pm

Request Review

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 41 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@andersonleal, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b045dbf9-6e55-4ef2-aa9d-affe4cf9fa02

📥 Commits

Reviewing files that changed from the base of the PR and between 751c30e and 724e9a8.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • provider-openai-codex/src/stream_fn.rs
📝 Walkthrough

Walkthrough

Modified build_thinking_config in provider-anthropic to default to adaptive thinking when thinking_level is absent and the model explicitly supports thinking (supports_thinking == Some(true)); otherwise config remains disabled. Updated tests to cover both branches, replacing the previous single "absent means off" test.

Changes

Adaptive Thinking Default Behavior

Layer / File(s) Summary
Conditional adaptive default and tests
provider-anthropic/src/thinking.rs
Absent thinking_level now yields config: Some(ADAPTIVE) when the model supports thinking, else config: None; effort stays None and warnings empty. Tests split into two cases covering supported and unsupported/unknown models.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

A rabbit peeks at models near,
"Do you think?" it asks with cheer.
If yes, adaptive thoughts unfold,
If not, the config stays cold.
Two tests now hop where one once stood— 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: enabling adaptive thinking by default for thinking-capable Anthropic models.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch andersonleal/mot-3929-provider-anthropic-surface-adaptive-thinking-by-default-on

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…lippy)

Pre-existing clippy::collapsible_if failure from #460, unrelated to
this PR's change but blocking CI on this branch since it touches
provider-openai-codex/Cargo.lock. No behavior change.
install.iii.dev's install.sh calls the GitHub API to resolve the
release; unauthenticated it's capped at 60/hr and intermittently
fails "interface boot smoke" jobs across workers (hit twice on this
PR alone). The script's own error message points at $GITHUB_TOKEN,
so export the job's token to lift the cap to the authenticated rate.
@andersonleal
andersonleal merged commit dd6ad56 into main Jul 9, 2026
32 checks passed
@andersonleal
andersonleal deleted the andersonleal/mot-3929-provider-anthropic-surface-adaptive-thinking-by-default-on branch July 9, 2026 16:47
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.

1 participant