Skip to content

Conversation

@enyst
Copy link
Collaborator

@enyst enyst commented Nov 25, 2025

Summary

  • Investigated Anthropic Claude model ID formats across providers
  • Removed unsupported dotted version patterns (e.g., claude-sonnet-4.5) from feature detection
  • Kept the official hyphenated IDs used by Anthropic, Amazon Bedrock, Google Vertex AI, and Microsoft Foundry
  • Adjusted tests accordingly

Fixes: #1260

Context
The codebase allowed both hyphenated (e.g., claude-sonnet-4-5-20250929) and dotted (e.g., claude-sonnet-4.5-20250929) variants for Claude models. Based on a review of official provider docs and catalogs, the dotted pattern does not appear in real provider model IDs.

What changed

  • openhands-sdk/openhands/sdk/llm/utils/model_features.py
    • Drop dotted patterns from PROMPT_CACHE_PATTERNS (keep hyphen-only)
  • openhands-sdk/openhands/sdk/llm/llm.py
    • Remove dotted claude-3.7 pattern variant from max_output_tokens guard
  • tests/sdk/llm/test_model_features.py
    • Update tests to only assert hyphenated Anthropic IDs

Evidence / References

Testing

  • Ran pre-commit (ruff, pyright, pycodestyle) on edited files
  • Ran targeted tests in tests/sdk/llm/test_model_features.py: 96 passed

Breaking changes

  • None expected. We only removed acceptance for dotted variants which are not used by official providers.

Checklist

  • Code follows repo conventions (no mypy; pyright clean)
  • Minimal, focused changes
  • Tests adjusted and passing for the affected module
  • No docs updates required in this repo

Co-authored-by: openhands openhands@all-hands.dev

@enyst 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

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.12-nodejs22 Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:cbbd792-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-cbbd792-python \
  ghcr.io/openhands/agent-server:cbbd792-python

All tags pushed for this build

ghcr.io/openhands/agent-server:cbbd792-golang-amd64
ghcr.io/openhands/agent-server:cbbd792-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:cbbd792-golang-arm64
ghcr.io/openhands/agent-server:cbbd792-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:cbbd792-java-amd64
ghcr.io/openhands/agent-server:cbbd792-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:cbbd792-java-arm64
ghcr.io/openhands/agent-server:cbbd792-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:cbbd792-python-amd64
ghcr.io/openhands/agent-server:cbbd792-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-amd64
ghcr.io/openhands/agent-server:cbbd792-python-arm64
ghcr.io/openhands/agent-server:cbbd792-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-arm64
ghcr.io/openhands/agent-server:cbbd792-golang
ghcr.io/openhands/agent-server:cbbd792-java
ghcr.io/openhands/agent-server:cbbd792-python

About Multi-Architecture Support

  • Each variant tag (e.g., cbbd792-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., cbbd792-python-amd64) are also available if needed

…es with official IDs

- Drop dotted variants like 'claude-sonnet-4.5' and 'claude-haiku-4.5'
- Keep hyphenated forms used by Anthropic, Bedrock, Vertex, and Foundry
- Adjust tests accordingly and simplify hyphen-only matching

Closes #1260

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions
Copy link
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands-sdk/openhands/sdk/llm
   llm.py40915163%332, 336, 343, 347, 351, 355–357, 361–362, 373–374, 376–377, 381, 398, 432, 441, 461, 490, 511, 515, 530, 536–537, 556–557, 567, 592–597, 618–619, 622, 626, 638, 643–646, 653, 656, 664–669, 673–676, 678, 691, 695–697, 699–700, 705–706, 708, 715, 718–723, 820–821, 824–827, 868, 882, 936, 939–941, 944–952, 956–958, 961, 964–966, 973–974, 983, 990–992, 996, 998–1003, 1005–1022, 1025–1029, 1031–1032, 1038–1047, 1060, 1074, 1079
openhands-sdk/openhands/sdk/llm/utils
   model_features.py32196%135
TOTAL12309564854% 

@enyst enyst marked this pull request as ready for review November 25, 2025 15:30
@xingyaoww xingyaoww merged commit 771eecc into main Nov 25, 2025
21 checks passed
@xingyaoww xingyaoww deleted the openhands/investigate-claude-model-ids-1260 branch November 25, 2025 16:13
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.

Investigate Claude model names

3 participants