Skip to content

fix(anthropic): honor adaptive thinking config for newer Claude models#12909

Open
syf2211 wants to merge 1 commit into
continuedev:mainfrom
syf2211:fix/12908-anthropic-adaptive-thinking-config
Open

fix(anthropic): honor adaptive thinking config for newer Claude models#12909
syf2211 wants to merge 1 commit into
continuedev:mainfrom
syf2211:fix/12908-anthropic-adaptive-thinking-config

Conversation

@syf2211

@syf2211 syf2211 commented Jun 27, 2026

Copy link
Copy Markdown

Summary

Parse and forward Anthropic thinking / output_config completion options from config.yaml instead of always mapping the legacy reasoning toggle to thinking.type: enabled.

Motivation

Claude Opus 4.x models reject thinking.type.enabled and require thinking.type.adaptive with output_config.effort. Users who configured adaptive thinking in YAML still got API errors because Continue stripped unknown completion-option fields and the chat UI forced reasoning: true.

Fixes #12908

Changes

File Change
packages/config-yaml/src/schemas/models.ts Add thinking and output_config to completion options schema
core/index.d.ts Extend BaseCompletionOptions types
core/llm/llms/Anthropic.ts Prefer explicit thinking config over legacy reasoning boolean
gui/src/redux/thunks/streamNormalInput.ts Skip legacy reasoning toggle when model config already sets thinking.type
core/llm/llms/Anthropic.vitest.ts Regression tests for adaptive thinking request bodies

Tests

  • Added Anthropic.vitest.ts cases for adaptive thinking + output_config, and for config precedence over legacy reasoning: true
  • Full vitest suite could not be executed locally due to monorepo workspace package resolution in this environment; CI should run project tests

Notes

  • Legacy reasoning: true behavior is unchanged when no thinking block is configured
  • output_config.effort enum currently covers low/medium/high; API may add more values later
  • Bedrock provider may need a similar follow-up for Opus 4.x on Bedrock

Summary by cubic

Honor Anthropic thinking and output_config from YAML and per-request options, preferring them over the legacy reasoning flag. This fixes Claude Opus 4.x errors by supporting thinking.type: adaptive with output_config.effort (fixes #12908).

  • Bug Fixes
    • Parse thinking and output_config in packages/config-yaml; add types in core/index.d.ts.
    • Build Anthropic requests with explicit thinking (incl. budget_tokens for enabled) and optional output_config; fall back to legacy reasoning only if thinking isn’t set.
    • In gui, skip adding the legacy reasoning toggle when thinking.type is configured.
    • Add tests to forward adaptive thinking/output_config and ensure config overrides legacy reasoning; include required model in completionOptions.

Written for commit 8f4d77d. Summary will update on new commits.

Review in cubic

@syf2211 syf2211 requested a review from a team as a code owner June 27, 2026 06:13
@syf2211 syf2211 requested review from sestinj and removed request for a team June 27, 2026 06:13
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 27, 2026
@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 5 files

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

Re-trigger cubic

Comment thread core/llm/llms/Anthropic.ts
@syf2211

syf2211 commented Jun 27, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@syf2211

syf2211 commented Jun 27, 2026

Copy link
Copy Markdown
Author

recheck

- Parse thinking and output_config in completion options schema
- Forward adaptive thinking/output_config to Anthropic API requests
- Skip legacy reasoning toggle when model config specifies thinking
- Add regression tests for adaptive thinking request bodies
- test: add required model field to completionOptions in vitest

Fixes continuedev#12908
@syf2211 syf2211 force-pushed the fix/12908-anthropic-adaptive-thinking-config branch from 5b16ed6 to 8f4d77d Compare June 27, 2026 06:59
@syf2211

syf2211 commented Jun 27, 2026

Copy link
Copy Markdown
Author

recheck

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

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

continue seems to be ignoring my thinking type in the config

1 participant