Repository navigation
Description
Summary
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/geminihavesession_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_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). - It is currently retained only as backward-compat for older claude CLIs (≤ 0.29.x) that still honor
_meta(seetests/sdk/settings/test_acp_providers.pyv0.29.0case).
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 aremoved_inversion (5-minor public-API runway). - Set
claude-code'ssession_meta_key=None; then remove thesession_meta_keyfield fromACPProviderInfo. - Drop the
session_meta = build_session_model_meta(...)build and thenew_session(**session_meta)spread inACPAgent.init_state→ plainnew_session(cwd=..., mcp_servers=...). - Update/remove the
build_session_model_metatests.
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.
Refs
- Discovered while validating ACP: persist pre-session model switch instead of raising (switch_acp_model loses the model before first run()) #3763 / fix(acp): persist pre-session model switch instead of raising #3764 (pre-session model-switch persistence).
- ACP claude-code initial model selection via session _meta is silently ignored by claude-agent-acp 0.30.0 #3654 (claude →
supports_set_session_model=True). - Touch points:
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).
Activity
github-actions commentedon Jul 28, 2026
This issue is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.
github-actions commentedon Aug 7, 2026
This issue was automatically closed due to 50 days of inactivity. We do this to help keep the issues somewhat manageable and focus on active issues.