Skip to content

ACP: model prefix not stripped when dispatching to Claude ACP adapter — Cannot replay saved model "anthropic/claude-sonnet-4-6" #91513

Closed

Description

@karthikbhaskar-1

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

  1. Configure Claude ACP agent
  2. Spawn with explicit model: sessions_spawn(agentId="claude", runtime="acp", model="anthropic/claude-sonnet-4-6")
  3. 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-acp 0.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

Activity

  1. clawsweeper commented on Jun 8, 2026

    @clawsweeper
    Contributor

    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

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.

    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:

    • No live Claude ACP session was run during this read-only review; a fix PR should include real adapter proof against a redacted Claude/acpx setup.
    • The repair should be adapter-aware and avoid broad provider-prefix stripping for ACP agents that legitimately use provider-qualified model ids.

    Codex review notes: model gpt-5.5, reasoning high; reviewed against 6c4fb997e52e.

    Label changes

    Label changes:

    • add 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.
    • add impact:auth-provider: The affected behavior is model-choice routing between OpenClaw canonical Anthropic refs and the Claude ACP adapter's advertised model ids.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:queueable-fix: Current issue advisory state selects this label.
    • add 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:

    • 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
    • Manual or live proof: spawn a real Claude ACP/acpx session with model=anthropic/claude-sonnet-4-6 and capture redacted terminal/log output showing the selected model no longer fails replay.
    • Check v2026.6.1/current dependency behavior when deciding whether to patch OpenClaw wrapper code or bump to a fixed acpx release.

    What I checked:

    • Repository policy read: Root AGENTS.md was read in full, and the scoped guides for src/agents, docs, and extensions/acpx were read before judging the ACPX and spawn paths. (AGENTS.md:1, 6c4fb997e52e)
    • Spawn stores canonical model ref: ACP spawns resolve the requested model and persist it unchanged into runtimeOptions.model when a model override is present. (src/agents/acp-spawn.ts:1053, 6c4fb997e52e)
    • Manager passes model to runtime startup: ensureManagerRuntimeHandle reads runtimeOptions.model and passes it as the model field to runtime.ensureSession. (src/acp/control-plane/manager.runtime-handle-ensure.ts:104, 6c4fb997e52e)
    • ACPX wrapper only normalizes Codex models: Current ACPX wrapper normalizes Codex model refs but sends non-Codex ensureSession input through withAcpxSessionOptions, preserving the full model value in sessionOptions. (extensions/acpx/src/runtime.ts:967, 6c4fb997e52e)
    • ACPX dependency rejects non-advertised model ids: The pinned acpx 0.10.0 package checks requested/replayed model ids by exact membership in models.availableModels and throws the reported replay error when the requested id is not advertised.
    • Current and shipped dependency pins: Current main and v2026.6.1 both pin @agentclientprotocol/claude-agent-acp 0.39.0 and acpx 0.10.0, so the latest release does not differ on this dependency surface. (extensions/acpx/package.json:11, 6c4fb997e52e)

    Likely related people:

    • Shakker: Current blame for the ACPX wrapper, ACP runtime-options helpers, and ACP spawn model plumbing in this checkout points to da40134. (role: recent area contributor; confidence: medium; commits: da401341b685; files: extensions/acpx/src/runtime.ts, src/acp/control-plane/runtime-options.ts, src/agents/acp-spawn.ts)
    • InTheCloudDan: The related merged ACP runtime-option mapping work covered Claude/Codex/Gemini config key dialects and is directly adjacent to this model-option replay path. (role: adjacent feature contributor; confidence: medium; commits: c2f4f251c97c; files: 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 keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P2Normal backlog priority with limited blast radius.
    impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jun 8, 2026
  3. self-assigned this
    on Jun 9, 2026
  4. vincentkoc commented on Jun 9, 2026

    @vincentkoc
    Member

    Fixed on main in dfb4491.

    Behavior changed: Claude ACP startup/control model refs now strip the OpenClaw anthropic/ provider prefix and preserve Claude canonical claude-* model ids before ACPX sees them. That matches ACPX's exact advertised-model gate and avoids replaying anthropic/claude-sonnet-4-6 into 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.
    • Testbox through Crabbox: provider blacksmith-testbox, id tbx_01ktmy34w1d7a177gcyd4vpp7a, command corepack pnpm check:changed, exit 0.

    Closing as fixed.

  5. locked as resolved and limited conversation to collaborators on Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions