fix(anthropic): honor adaptive thinking config for newer Claude models#12909
Open
syf2211 wants to merge 1 commit into
Open
fix(anthropic): honor adaptive thinking config for newer Claude models#12909syf2211 wants to merge 1 commit into
syf2211 wants to merge 1 commit into
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
There was a problem hiding this comment.
1 issue found across 5 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Author
|
I have read the CLA Document and I hereby sign the CLA |
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
5b16ed6 to
8f4d77d
Compare
Author
|
recheck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Parse and forward Anthropic
thinking/output_configcompletion options from config.yaml instead of always mapping the legacy reasoning toggle tothinking.type: enabled.Motivation
Claude Opus 4.x models reject
thinking.type.enabledand requirethinking.type.adaptivewithoutput_config.effort. Users who configured adaptive thinking in YAML still got API errors because Continue stripped unknown completion-option fields and the chat UI forcedreasoning: true.Fixes #12908
Changes
packages/config-yaml/src/schemas/models.tsthinkingandoutput_configto completion options schemacore/index.d.tsBaseCompletionOptionstypescore/llm/llms/Anthropic.tsreasoningbooleangui/src/redux/thunks/streamNormalInput.tsthinking.typecore/llm/llms/Anthropic.vitest.tsTests
Anthropic.vitest.tscases for adaptive thinking +output_config, and for config precedence over legacyreasoning: trueNotes
reasoning: truebehavior is unchanged when nothinkingblock is configuredoutput_config.effortenum currently covers low/medium/high; API may add more values laterSummary by cubic
Honor Anthropic
thinkingandoutput_configfrom YAML and per-request options, preferring them over the legacyreasoningflag. This fixes Claude Opus 4.x errors by supportingthinking.type: adaptivewithoutput_config.effort(fixes #12908).thinkingandoutput_configinpackages/config-yaml; add types incore/index.d.ts.thinking(incl.budget_tokensforenabled) and optionaloutput_config; fall back to legacyreasoningonly ifthinkingisn’t set.gui, skip adding the legacyreasoningtoggle whenthinking.typeis configured.thinking/output_configand ensure config overrides legacyreasoning; include requiredmodelincompletionOptions.Written for commit 8f4d77d. Summary will update on new commits.