Repository navigation
Description
Summary
claude-agent-acp@0.30.0 (the Dockerfile-pinned CLI) does not apply the _meta {"claudeCode": {"options": {"model": ...}}} initial-model selection that the SDK's claude-code init path relies on. The requested model is registered as a "Custom model" picker option, but the session keeps currentModelId="default" and every turn runs on the CLI's default model (currently Opus). The SDK therefore silently ignores acp_model for claude-code at session creation — including the curated defaults shipped in #3653.
Evidence (from the #3651 audit, raw JSON-RPC against the pinned CLI)
session/newwith_meta: {"claudeCode": {"options": {"model": "claude-haiku-4-5"}}}→ responsemodels.currentModelIdstays"default"; the subsequent prompt'susage_updatereports a 1,000,000-token context and Opus-level cost — i.e. the turn ran on default Opus, not Haiku.- A bogus ID (
claude-bogus-9-9) in_meta"succeeds" silently: registered as a custom option, session runs on default, prompt completes. No error is ever surfaced. session/set_modelon the same CLI both validates (claude-bogus-9-9→-32603 "It may not exist or you may not have access to it") and applies (afterset_model("claude-haiku-4-5"),config_option_updateshowscurrentValue="claude-haiku-4-5"and usage telemetry shows the 200k Haiku context). All 6 curated Claude models pass end-to-end via this path.
Where the SDK goes wrong
ACP_PROVIDERS["claude-code"]hassupports_set_session_model=False+session_meta_key="claudeCode", so_maybe_set_session_model()deliberately skips the protocol call at init ("claude already received the model innew_session()") — but it didn't.ACPAgent.current_model_idis overridden byself.acp_modelwhen set, so downstream clients report the chosen model while the session actually runsdefault— the UI lies.
Proposed fix
Flip claude-code to supports_set_session_model=True so the init path issues the one-shot session/set_model (the same call the runtime switch and the resume-reapply path already use, and the path the audit validated end-to-end for every curated model). Keep session_meta_key — sending the same model via _meta stays harmless and keeps working if a future CLI honours it.
Behavioural consequence (desired): an invalid/inaccessible acp_model now fails session init loudly with the CLI's -32603 instead of silently running on default — matching codex/gemini behaviour.
Refs
- Audit: audit: remove broken/unsupported models from ACP provider model lists #3651 (see the "Side finding" comment with full telemetry)
- Curated model lists: refactor(sdk): curate ACP model lists — verified against pinned CLIs, current generations only #3653
Activity
simonrosenberg commentedon Jun 11, 2026
Version-currency check: the pinned
claude-agent-acp@0.30.0is well behind — npm latest is 0.44.0 (2026-06-09; the project ships ~2–3 releases/week). Probed 0.44.0 with the same harness:session/set_modelis REMOVED →-32601 "Method not found": session/set_model, andsession/newno longer returns amodelsblock. Model selection moved to the generic config-options surface: theconfig_option_updatecarries{"id": "model", ...}with the live lineup, and switching is presumablysession/set_config_option(configId="model")._metabug persists on 0.44.0: requestingclaude-haiku-4-5via_metaregisters it as a picker option butcurrentValuestays on the account default. So bumping the pin would not have fixed ACP claude-code initial model selection via session _meta is silently ignored by claude-agent-acp 0.30.0 #3654.claude-fable-5[1m]("Fable 5 · most capable"),sonnet(4.6),haiku(4.5).Implications:
set_session_modelis the validated path (and the same call the runtime-switch and resume-reapply paths already use today).set_modelremoval will break all threeset_session_modelcall sites with-32601. The SDK already has aset_config_option(config_id="model")fallback for unknown providers — a follow-up should extend that fallback to known providers on-32601, which would make the SDK work on both old and new CLI generations. Happy to file/implement that as a separate issue when a bump is planned.docs(acp): correct switch_acp_model docstring — Claude applies via se…
refactor(acp): correct stale comment + key override_applied on the pr…