Repository navigation
Description
Bug
When spawning an ACP session with an explicit Claude model (e.g. anthropic/claude-sonnet-4-6 or anthropic/claude-opus-4-8), OpenClaw passes the full provider/model ID to the Claude ACP adapter. The adapter only accepts short names like sonnet, haiku, opus, default.
This causes every explicit model override to fail:
AcpRuntimeError: Failed to replay saved session model anthropic/claude-sonnet-4-6 on fresh ACP session: Cannot replay saved model "anthropic/claude-sonnet-4-6": the ACP agent did not advertise that model.
Steps to Reproduce
- Configure Claude ACP agent
- Spawn with explicit model:
sessions_spawn(agentId="claude", runtime="acp", model="anthropic/claude-sonnet-4-6") - Session fails immediately with the prefix error
Expected Behavior
OpenClaw should strip the anthropic/ provider prefix before passing the model ID to the Claude ACP adapter, or map to the adapter's short model names (sonnet, haiku, opus).
Workaround
ACP works with Claude models only when no model override is specified — the adapter picks its default model. You cannot select a specific Claude model via ACP today.
Environment
- OpenClaw 2026.6.1 (stable)
- Claude ACP adapter (
@agentclientprotocol/claude-agent-acp0.36.1) - Affected models:
anthropic/claude-sonnet-4-6,anthropic/claude-opus-4-8,anthropic/claude-haiku-4-5,anthropic/claude-opus-4-7
Root Cause
In runtime-DE8CprWy.js, the ACP session model replay passes the full OpenClaw model ID (anthropic/claude-*) to client.setSessionConfigOption(sessionId, "model", modelId). The Claude ACP adapter advertises short names (default, sonnet, sonnet[1m], haiku, opus) and rejects full provider-prefixed IDs.
The relevant code path is in AcpRuntimeManager.setConfigOption() which calls resolveSupportedConfigOptionId() for the model config key. For model, it skips the desired_config_options tracking (line 5675: if (configId !== "model")) but still passes the unstripped model ID to the ACP client.
Related
- PR Google Gemini chat model routes to openai-responses transport (401), native @google/genai transport never selected #88480/fix(google): add missing gemini-3.1-flash-lite to google-vertex catalog #89400 adds "strip provider self-prefixes" but only for Kim cache markers / provider replay, not ACP session model dispatch
- PR [codex] Map ACP thinking to advertised effort key #79926 maps canonical runtime options to backend-advertised ACP config keys but does not handle model ID normalization
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 8, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 8, 2026, 5:50 PM ET / 21:50 UTC.
Summary
Keep open: current main still forwards Claude ACP model overrides as canonical OpenClaw refs, while the acpx model replay guard requires an exact advertised ACP model id, so the reported stable-release failure remains plausible and source-backed.
Reproducibility: no. live ACP session was run, but the issue is source-reproducible: OpenClaw persists the full model ref and acpx 0.10.0 rejects requested/replayed models that are not exact advertised ids.
Ways to help us reproduce this
Next step
This is a narrow source-backed ACPX/Claude model-normalization bug with clear files and validation, so it is a good repair-lane candidate.
Review details
Best possible solution:
Add adapter-aware Claude ACP model normalization at the ACPX startup/replay/control boundary, or consume an acpx release that does so, while preserving canonical OpenClaw metadata and adding regression plus live Claude ACP proof.
Do we have a high-confidence way to reproduce the issue?
No live ACP session was run, but the issue is source-reproducible: OpenClaw persists the full model ref and acpx 0.10.0 rejects requested/replayed models that are not exact advertised ids.
Is this the best way to solve the issue?
Yes, the right fix is narrow model-id normalization at the Claude ACP/acpx boundary rather than a new config knob or broad core provider rewrite.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 6c4fb997e52e.
Label changes
Label changes:
P2: The issue blocks explicit Claude ACP model selection on stable releases, but it is scoped to one ACP runtime/model override path with a default-model workaround.impact:auth-provider: The affected behavior is model-choice routing between OpenClaw canonical Anthropic refs and the Claude ACP adapter's advertised model ids.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.Label justifications:
P2: The issue blocks explicit Claude ACP model selection on stable releases, but it is scoped to one ACP runtime/model override path with a default-model workaround.impact:auth-provider: The affected behavior is model-choice routing between OpenClaw canonical Anthropic refs and the Claude ACP adapter's advertised model ids.Evidence reviewed
Acceptance criteria:
What I checked:
AGENTS.md:1, 6c4fb997e52e)src/agents/acp-spawn.ts:1053, 6c4fb997e52e)src/acp/control-plane/manager.runtime-handle-ensure.ts:104, 6c4fb997e52e)extensions/acpx/src/runtime.ts:967, 6c4fb997e52e)extensions/acpx/package.json:11, 6c4fb997e52e)Likely related people:
extensions/acpx/src/runtime.ts,src/acp/control-plane/runtime-options.ts,src/agents/acp-spawn.ts)src/acp/control-plane/manager.runtime-controls.ts,src/acp/control-plane/manager.runtime-options-commands.ts,src/acp/control-plane/manager.runtime-config.test.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.vincentkoc commentedon Jun 9, 2026
Fixed on main in dfb4491.
Behavior changed: Claude ACP startup/control model refs now strip the OpenClaw
anthropic/provider prefix and preserve Claude canonicalclaude-*model ids before ACPX sees them. That matches ACPX's exact advertised-model gate and avoids replayinganthropic/claude-sonnet-4-6into the Claude ACP adapter.Proof run:
node scripts/run-vitest.mjs extensions/acpx/src/runtime.test.ts src/acp/control-plane/manager.runtime-config.test.ts src/agents/acp-spawn.test.ts— 3 shards, 130 tests passed..agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main— clean; no accepted/actionable findings.blacksmith-testbox, idtbx_01ktmy34w1d7a177gcyd4vpp7a, commandcorepack pnpm check:changed, exit 0.Closing as fixed.