Fix: Add claude-sonnet-4-6 to EXTENDED_THINKING_MODELS#2138
Merged
juanmichelini merged 1 commit intomainfrom Feb 19, 2026
Merged
Fix: Add claude-sonnet-4-6 to EXTENDED_THINKING_MODELS#2138juanmichelini merged 1 commit intomainfrom
juanmichelini merged 1 commit intomainfrom
Conversation
This fix resolves issue #2137 where Claude Sonnet 4.6 rejects API requests with both temperature AND top_p parameters specified. By adding claude-sonnet-4-6 to EXTENDED_THINKING_MODELS, the SDK now automatically strips both temperature and top_p parameters before sending requests to Anthropic's API, preventing the error. Also added claude-sonnet-4-5 and claude-sonnet-4-6 to PROMPT_CACHE_MODELS for consistency with other Claude 4.x models. Changes: - Added claude-sonnet-4-6 to EXTENDED_THINKING_MODELS list - Added claude-sonnet-4-5 and claude-sonnet-4-6 to PROMPT_CACHE_MODELS - Added comprehensive tests to verify extended thinking support - Added regression test for temperature/top_p stripping behavior Co-authored-by: openhands <openhands@all-hands.dev>
all-hands-bot
approved these changes
Feb 19, 2026
Collaborator
all-hands-bot
left a comment
There was a problem hiding this comment.
🟢 Good taste - Clean fix following existing patterns.
Solves a real production problem (100% eval failure) with a simple, pragmatic solution. Tests cover the actual behavior. The addition of both 4-5 and 4-6 to PROMPT_CACHE_MODELS is good housekeeping.
LGTM! 👍
Contributor
5 tasks
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
This PR fixes issue #2137 where Claude Sonnet 4.6 rejects API requests when both
temperatureANDtop_pparameters are specified together.Problem
Claude Sonnet 4.6 evaluations were failing with 100% error rate because:
top_p=1.0by defaulttemperature=0.1Anthropic's API documentation states:
Solution
Added
claude-sonnet-4-6to theEXTENDED_THINKING_MODELSlist, following the same pattern asclaude-sonnet-4-5andclaude-haiku-4-5. This ensures that when the model is used, bothtemperatureandtop_pare automatically stripped from the API call.Additionally:
claude-sonnet-4-5andclaude-sonnet-4-6toPROMPT_CACHE_MODELSfor consistency with other Claude 4.x models that support prompt caching.Changes Made
claude-sonnet-4-6toEXTENDED_THINKING_MODELSlist inmodel_features.pyclaude-sonnet-4-5andclaude-sonnet-4-6toPROMPT_CACHE_MODELSlisttest_model_features.pytest_chat_options.pyTesting
All tests pass successfully:
test_extended_thinking_supportverifies thatclaude-sonnet-4-6is correctly recognizedtest_claude_sonnet_4_6_strips_temp_and_top_pverifies the fix addresses the specific issuetest_prompt_cache_supportto includeclaude-sonnet-4-6Closes #2137
Checklist
@juanmichelini can click here to continue refining the PR
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.12-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:6f9fa7e-pythonRun
All tags pushed for this build
About Multi-Architecture Support
6f9fa7e-python) is a multi-arch manifest supporting both amd64 and arm646f9fa7e-python-amd64) are also available if needed