Skip to content

Conversation

enyst
Copy link
Collaborator

@enyst enyst commented Oct 6, 2025

fix #11248

Summary

  • Normalize Bedrock-style region.vendor prefixes (e.g., us.anthropic.*) so Sonnet 4.5 is recognized as a reasoning model
  • Add pattern for dot variant (claude-sonnet-4.5*) in addition to dash variant
  • Avoid sending reasoning_effort to Claude Sonnet 4.5 (both - and . variants)
  • As a result, temperature/top_p are now correctly suppressed for Sonnet 4.5 reasoning models to prevent Bedrock 400 errors

Details

  • openhands/llm/model_features.py
    • normalize_model_name: strips dotted prefixes up to the first known vendor (anthropic, meta, cohere, mistral, ai21, amazon); handles cases like bedrock/us.anthropic.claude-sonnet-4-5-20250929-v1:0 -> claude-sonnet-4-5-20250929-v1
    • REASONING_EFFORT_PATTERNS: added claude-sonnet-4.5*
  • openhands/llm/llm.py
    • For reasoning models: as before, pop temperature and top_p
    • Special-case extended to also drop reasoning_effort for claude-sonnet-4.5

Verification

  • Verified that normalization maps Bedrock model IDs to canonical basenames used by matching
  • Verified that Sonnet 4.5 (dash or dot variants) triggers reasoning behavior and does not receive reasoning_effort

No dependency changes.

Co-authored-by: openhands [email protected]

@enyst can click here to continue refining the PR


To run this PR locally, use the following command:

GUI with Docker:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:668e271-nikolaik   --name openhands-app-668e271   docker.all-hands.dev/all-hands-ai/openhands:668e271

CLI with uvx:

uvx --python 3.12 --from git+https://github.com/All-Hands-AI/OpenHands@fix/sonnet-4-5-bedrock-normalization#subdirectory=openhands-cli openhands

… dot variant for Sonnet 4.5; llm: avoid reasoning_effort for Sonnet 4.5\n\nFix: #11248\n\nCo-authored-by: openhands <[email protected]>
Copy link

openhands-ai bot commented Oct 6, 2025

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • Run Python Tests

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #11259 at branch `fix/sonnet-4-5-bedrock-normalization`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

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.

[Bug]: 'bedrock/us.anthropic.claude-sonnet-4-5-20250929-v1:0' not working when running openhands in headless model with docker

1 participant