Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions openhands-sdk/openhands/sdk/settings/acp_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,19 +294,22 @@ class ACPProviderInfo:
# ---------------------------------------------------------------------------

# Model IDs the Claude Code CLI accepts, mirroring the ``model`` configOptions
# select claude-agent-acp 0.44.0 reports at ``session/new`` (the short aliases
# the CLI's own ``/model`` menu offers, switched via ``set_config_option``).
# select claude-agent-acp reports at ``session/new`` (the short aliases the CLI's
# own ``/model`` menu offers, switched via ``set_config_option``).
# ``opus[1m]`` is the SDK-documented version-agnostic 1M-context alias and the
# CLI's own default (``currentValue``); ``default`` is the CLI's recommended
# tier (Opus 4.8 · 1M). The ``/model`` menu is dynamic/account-dependent and the
# CLI validates ``set_config_option(model)`` against the live select — it rejects
# an absent id (e.g. ``sonnet`` on accounts without it), so these are pre-session
# suggestions, not ground truth; a rejected id degrades to the server default.
# CLI's own default (``currentValue``); ``default`` is the CLI's recommended tier
# for the account. ``claude-opus-5`` is the explicit full model pin for users who
# want Opus 5 rather than the provider-dependent alias. The ``/model`` menu is
# dynamic/account-dependent and the CLI validates ``set_config_option(model)``
# against the live select — it rejects an absent id (e.g. ``sonnet`` on accounts
# without it), so these are pre-session suggestions, not ground truth; a rejected
# id degrades to the server default.
_CLAUDE_MODELS: tuple[ACPModelOption, ...] = (
ACPModelOption(id="default", label="Default (recommended)"),
ACPModelOption(id="opus[1m]", label="Claude Opus 4.8 (1M)"),
ACPModelOption(id="sonnet", label="Claude Sonnet 4.6"),
ACPModelOption(id="haiku", label="Claude Haiku 4.5"),
ACPModelOption(id="opus[1m]", label="Claude Opus (1M)"),
ACPModelOption(id="claude-opus-5", label="Claude Opus 5"),
ACPModelOption(id="sonnet", label="Claude Sonnet"),
ACPModelOption(id="haiku", label="Claude Haiku"),
)

# Bare preset ids advertised by the Codex app server through
Expand Down
6 changes: 5 additions & 1 deletion tests/sdk/settings/test_acp_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ def test_claude_code_metadata(self):
assert info.supports_runtime_model_switch is True
assert info.session_meta_key == "claudeCode"
assert info.default_model == "opus[1m]"
assert any(m.id == "opus[1m]" for m in info.available_models)
models = {model.id: model.label for model in info.available_models}
assert models["opus[1m]"] == "Claude Opus (1M)"
assert models["claude-opus-5"] == "Claude Opus 5"
assert models["sonnet"] == "Claude Sonnet"
assert models["haiku"] == "Claude Haiku"
# Pinned binary exposed by the agent-server image wrappers.
assert info.binary_name == "claude-agent-acp"
assert info.data_dir_env_var == "CLAUDE_CONFIG_DIR"
Expand Down
Loading