You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deprecate and eventually remove the ACP session/new_meta model-selection path — build_session_model_meta(), ACPProviderInfo.session_meta_key, and the new_session(**session_meta) spread in ACPAgent — now that set_session_model is the universal initial-model mechanism for every built-in ACP provider.
Background
Originally, claude-agent-acp selected its initial model via a session/new_meta payload ({"claudeCode": {"options": {"model": ...}}}), while codex/gemini used the set_session_model protocol call. #3654 flipped claude-code to supports_set_session_model=True, so _maybe_set_session_model() now issues set_session_model for all built-in providers (codex, gemini, claude-code).
As a result the _meta path is vestigial:
It is built only for claude-code (codex/gemini have session_meta_key=None).
On the pinned claude-agent-acp0.30.0 it is a no-op — the payload only adds a picker option; set_session_model is what actually applies the model. Validated end-to-end in fix(acp): persist pre-session model switch instead of raising #3764 against the real CLI: a pre-run switch Opus→Haiku ran as Haiku and Opus→Sonnet ran as Sonnet, applied via set_session_model (the running model self-identified).
It is currently retained only as backward-compat for older claude CLIs (≤ 0.29.x) that still honor _meta (see tests/sdk/settings/test_acp_providers.pyv0.29.0 case).
build_session_model_meta is also a public exported symbol (openhands.sdk and openhands.sdk.settings), so removal must go through the API-breakage deprecation runway (qualified feature name + removed_in), per the pattern in #3652.
Proposal
Once we're comfortable that no supported deployment runs claude-agent-acp < 0.30.0 (today CLAUDE_AGENT_ACP_VERSION = "0.30.0" and resolve_acp_command rewrites npx → the pinned binary, so prod runs 0.30.0; the only escape hatch is a caller-supplied acp_command):
Deprecate build_session_model_meta() with a removed_in version (5-minor public-API runway).
Set claude-code's session_meta_key=None; then remove the session_meta_key field from ACPProviderInfo.
Drop the session_meta = build_session_model_meta(...) build and the new_session(**session_meta) spread in ACPAgent.init_state → plain new_session(cwd=..., mcp_servers=...).
Update/remove the build_session_model_meta tests.
current_model_id already keys its honesty on the set_session_model call (not _meta) after the #3764 follow-up (override_applied = applied_via_call), so removing _meta is behavior-preserving for the pinned CLI.
Open question
Do we want to keep any support for claude-agent-acp ≤ 0.29.x (where _meta is the only working initial-model path and set_session_model on a fresh session may not be honored)? If not — drop it entirely. If yes — gate _meta behind a detected CLI version rather than carrying it unconditionally.
Summary
Deprecate and eventually remove the ACP
session/new_metamodel-selection path —build_session_model_meta(),ACPProviderInfo.session_meta_key, and thenew_session(**session_meta)spread inACPAgent— now thatset_session_modelis the universal initial-model mechanism for every built-in ACP provider.Background
Originally, claude-agent-acp selected its initial model via a
session/new_metapayload ({"claudeCode": {"options": {"model": ...}}}), while codex/gemini used theset_session_modelprotocol call. #3654 flippedclaude-codetosupports_set_session_model=True, so_maybe_set_session_model()now issuesset_session_modelfor all built-in providers (codex, gemini, claude-code).As a result the
_metapath is vestigial:claude-code(codex/geminihavesession_meta_key=None).claude-agent-acp0.30.0 it is a no-op — the payload only adds a picker option;set_session_modelis what actually applies the model. Validated end-to-end in fix(acp): persist pre-session model switch instead of raising #3764 against the real CLI: a pre-run switch Opus→Haiku ran as Haiku and Opus→Sonnet ran as Sonnet, applied viaset_session_model(the running model self-identified)._meta(seetests/sdk/settings/test_acp_providers.pyv0.29.0case).build_session_model_metais also a public exported symbol (openhands.sdkandopenhands.sdk.settings), so removal must go through the API-breakage deprecation runway (qualified feature name +removed_in), per the pattern in #3652.Proposal
Once we're comfortable that no supported deployment runs
claude-agent-acp < 0.30.0(todayCLAUDE_AGENT_ACP_VERSION = "0.30.0"andresolve_acp_commandrewritesnpx→ the pinned binary, so prod runs 0.30.0; the only escape hatch is a caller-suppliedacp_command):build_session_model_meta()with aremoved_inversion (5-minor public-API runway).claude-code'ssession_meta_key=None; then remove thesession_meta_keyfield fromACPProviderInfo.session_meta = build_session_model_meta(...)build and thenew_session(**session_meta)spread inACPAgent.init_state→ plainnew_session(cwd=..., mcp_servers=...).build_session_model_metatests.current_model_idalready keys its honesty on theset_session_modelcall (not_meta) after the #3764 follow-up (override_applied = applied_via_call), so removing_metais behavior-preserving for the pinned CLI.Open question
Do we want to keep any support for claude-agent-acp ≤ 0.29.x (where
_metais the only working initial-model path andset_session_modelon a fresh session may not be honored)? If not — drop it entirely. If yes — gate_metabehind a detected CLI version rather than carrying it unconditionally.Refs
supports_set_session_model=True).openhands-sdk/openhands/sdk/settings/acp_providers.py(build_session_model_meta,session_meta_key),openhands-sdk/openhands/sdk/agent/acp_agent.py(init_statefresh-session branch),openhands-sdk/openhands/sdk/__init__.py+settings/__init__.py(exports).