← Back to PRs

#10217: docs: add Anthropic adaptive thinking documentation for Opus 4.6

by GodsBoy open 2026-02-06 07:12 View on GitHub →
docs stale
## Summary This PR adds documentation and tests for Anthropic's adaptive thinking feature introduced in Claude Opus 4.6. ### Background Anthropic's Claude Opus 4.6 introduced **adaptive thinking** which replaces the deprecated `budget_tokens` approach. Instead of setting a fixed token budget, Claude dynamically decides when and how much to think. **Old (deprecated):** `thinking: {type: "enabled", budget_tokens: N}` **New:** `thinking: {type: "adaptive"}` ### Changes 1. **Documentation** (`docs/tools/thinking.md`): - Added section explaining adaptive thinking for Opus 4.6+ - Documented the thinking level to effort parameter mapping - Added examples of how to use thinking levels with Opus 4.6 2. **Tests** (`src/auto-reply/adaptive-thinking.test.ts`): - Tests verifying thinking level to effort mapping (minimal→low, low→low, medium→medium, high→high, xhigh→max) - Tests for Opus 4.6 model detection - Tests ensuring thinking level normalization works correctly for adaptive thinking ### Thinking Level to Effort Mapping | OpenClaw Level | Anthropic Effort | |----------------|------------------| | minimal | low | | low | low | | medium | medium | | high | high | | xhigh | max | ### Note The actual adaptive thinking implementation is already in `@mariozechner/pi-ai` 0.52.6 (which is now in OpenClaw's HEAD). This PR adds documentation to help users understand how their thinking level choices affect Opus 4.6 behavior. Closes #9837 --- Thanks to @TinyTb for the Opus 4.6 model catalog work in #9853! <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a new documentation section describing Anthropic “adaptive thinking” for Opus 4.6+ and introduces a new Vitest file intended to validate thinking-level → effort mapping and Opus 4.6 model detection. The docs change is self-contained in `docs/tools/thinking.md` and how OpenClaw thinking levels relate to Anthropic effort when using Opus 4.6. The new test file, however, mostly re-tests locally re-implemented helpers that “mirror” behavior in `@mariozechner/pi-ai`, rather than exercising any OpenClaw integration code path. As written it will pass regardless of whether OpenClaw’s actual adaptive-thinking behavior changes, so it doesn’t provide meaningful regression coverage. <h3>Confidence Score: 3/5</h3> - This PR is mostly safe, but the added tests don’t validate the real OpenClaw behavior they claim to cover. - Docs changes are straightforward, but the new adaptive-thinking tests primarily assert local helper functions that are not used by OpenClaw at runtime, so they can give a false sense of coverage and should be fixed before merging. - src/auto-reply/adaptive-thinking.test.ts <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs