Skip to content

[ENG-21157] fix(agents): Claude 5 models ignore the configured thinking level - #278

Merged
orswn merged 2 commits into
boonfrom
okka/eng-21157/claude-5-adaptive
Oct 11, 2026
Merged

orswn merged 2 commits into
boonfrom
okka/eng-21157/claude-5-adaptive

Conversation

@orswn

@orswn orswn commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Related: ENG-21157

What Problem This Solves

Fixes an issue where agents on Claude Opus 5, Opus 5.5, Sonnet 5 or Sonnet 5.5 do not use the configured thinking level.

The model contract knew adaptive thinking only up to Opus 4.8 and Sonnet 4.6. These models got the legacy request: thinking.type: enabled with budget_tokens and the interleaved-thinking beta. Bedrock rejects that form for them. Behind the Boon LLM gateway the request still worked, because the gateway rewrites it to adaptive. The rewrite sets no output_config.effort, so the model ran at its default effort and not at the configured medium.

Why This Change Was Made

supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort and supportsClaudeNativeXhighEffort now match the opus-5 and sonnet-5 families. This includes the -5-5 versions and gateway aliases such as claude-opus-5-5-bedrock. Upstream OpenClaw has the same coverage. Only the three patterns change. The bare opus alias and the other upstream Claude 5 helpers are not ported.

For these models, OpenClaw now sends:

  • adaptive thinking with output_config.effort from the thinking level;
  • no interleaved-thinking beta header;
  • no custom temperature. Opus 5.5 and Sonnet 5.5 reject it on Bedrock.

The Anthropic provider plugin also treats them as modern and 1M-context models, as upstream does.

Requests without a thinking level, such as chat titles, still send thinking.type: disabled. Opus 5.5 and Sonnet 5.5 reject that on Bedrock. getboon/boon-llm-gateway#129 handles it in the gateway.

User Impact

  • Agents on Opus 5.x and Sonnet 5.x think at the configured level.
  • The xhigh and max thinking levels are available for these models.
  • No change for Opus 4.7 and Opus 4.8, the current fleet primaries. No fleet or trial model matches the new patterns until the primary moves to Opus 5.5.
  • The fleet primary moves to Opus 5.5 only after this change is released, pinned, rolled to paid hosts and baked into the AMI.

Evidence

Focused tests:

node scripts/run-vitest.mjs run src/plugin-sdk/provider-model-shared.test.ts       15 passed
node scripts/run-vitest.mjs run src/agents/anthropic-transport-stream.test.ts      90 passed
node scripts/run-vitest.mjs run src/auto-reply/thinking.test.ts                    53 passed
node scripts/run-vitest.mjs run src/llm/providers/anthropic.test.ts extensions/anthropic/index.test.ts extensions/anthropic/cli-migration.test.ts src/commands/doctor/shared/legacy-config-migrate.test.ts
                                                                                    124 + 39 + 47 passed
pnpm tsgo:core          exit 0
pnpm tsgo:core:test     exit 0
oxfmt --check and oxlint on the 3 changed files: clean

The new transport test checks that claude-opus-5-5-bedrock at medium sends thinking: {type: "adaptive"}, output_config: {effort: "medium"}, no budget_tokens, and only the fine-grained-tool-streaming-2025-05-14 beta.

The temperature tests send temperature with thinking off, the way chat titles do. Opus 5.5, Sonnet 5.5 and the claude-opus-5-5-bedrock alias omit it. These 3 cases and the adaptive case fail on the previous contract.

Live Bedrock checks of the thinking contract:

Model enabled with budget adaptive, effort low / xhigh / max
us.anthropic.claude-opus-5 400 200 / 200 / 200
global.anthropic.claude-opus-5-5 400 200 / 200 / 200
us.anthropic.claude-sonnet-5 400 200 / 200 / 200
global.anthropic.claude-sonnet-5-5 400 200 / 200 / 200

The branch is rebased on boon at 2026.6.34-boon.5. After the rebase, the 5 focused test shards passed, and pnpm tsgo:core and oxfmt --check are clean.

Before this change, a local agent run on Opus 5.5 logged the gateway rewrite thinking.type=enabled→adaptive and dropping budget_tokens on every turn.

The Claude model contract listed adaptive thinking, xhigh effort and
max effort only up to Opus 4.8 and Sonnet 4.6. Opus 5, Opus 5.5,
Sonnet 5 and Sonnet 5.5 fell through to the legacy budget form:
thinking.type "enabled" with budget_tokens and the
interleaved-thinking beta.

Bedrock rejects that form for these models. Behind the Boon LLM
gateway the request still succeeded, because the gateway rewrites it
to adaptive. The rewrite sets no output_config.effort, so the model
ran at its default effort and not at the configured level.

Match the opus-5 and sonnet-5 families in the three contract checks,
as upstream OpenClaw already does. These models now get adaptive
thinking with the mapped effort, no interleaved-thinking beta and no
custom temperature.
@orswn
orswn requested a review from a team October 10, 2026 11:17

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

The Claude 5 contract change also stops OpenClaw from sending a custom
temperature to these models, but no test sent one. Chat titles are the
caller that matters: they send a temperature with thinking off.

Add Opus 5.5 and Sonnet 5.5 to the canonical temperature table, and a
case for the claude-opus-5-5-bedrock gateway alias with thinking off.
All three fail on the previous contract.
@orswn
orswn merged commit b0801ea into boon Oct 11, 2026
144 of 147 checks passed
@orswn
orswn deleted the okka/eng-21157/claude-5-adaptive branch October 11, 2026 15:39
orswn added a commit that referenced this pull request Oct 11, 2026
…4-boon.6 (#279)

Cut the fork release that ships the one commit on boon since
v2026.6.34-boon.5. Opus 5, Opus 5.5, Sonnet 5 and Sonnet 5.5 now get
adaptive thinking with the configured effort, no interleaved-thinking
beta and no custom temperature (#278, ENG-21157).

Bump root package.json and npm-shrinkwrap.json, all 136 plugin
manifests, and the version and openclaw peer floor in every extension
npm-shrinkwrap.json. Add the 2026.6.34-boon.6 CHANGELOG.md section and
the generated extensions/matrix/CHANGELOG.md entry. No dependency
changes.
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.

2 participants