Skip to content

fix(anthropic): omit temperature for opus-4-7 (#3417) - #3418

Merged
Re-bin merged 3 commits into
HKUDS:mainfrom
04cb:fix/anthropic-opus-4-7-temperature-3417
Apr 24, 2026
Merged

Re-bin merged 3 commits into
HKUDS:mainfrom
04cb:fix/anthropic-opus-4-7-temperature-3417

Conversation

@04cb

@04cb 04cb commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Closes #3417

claude-opus-4-7 deprecated temperature — the API returns 400 whenever it is present. _build_kwargs set it on all three paths; now gated behind a "opus-4-7" in model_name check.

@chengyongru chengyongru left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@chengyongru chengyongru added bug Something isn't working provider valid labels Apr 24, 2026
Re-bin added 2 commits April 24, 2026 07:30
The existing test only verified the adaptive path. Add two more cases:
- enabled thinking (high): temperature must also be omitted
- no thinking (None): temperature must still be omitted

Made-with: Cursor

@Re-bin Re-bin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is the right fix in the right place.

@Re-bin
Re-bin merged commit 3441d5f into HKUDS:main Apr 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working provider valid

Projects

None yet

Development

Successfully merging this pull request may close these issues.

anthropic_provider hardcodes temperature=1.0 with adaptive thinking — Claude Opus 4.7 rejects with 400

3 participants