-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
ACP runtime ignores per-agent model.primary override #87381
Copy link
Copy link
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
ACP runtime ignores per-agent
model.primaryoverride — always falls back to default modelDescription
When an agent is configured with a specific
model.primaryinopenclaw.json, the ACP runtime (acpx) does not apply this override at session initialization time. The Claude Code process is launched with the system default model instead.Expected: Agent
claude3with"model": {"primary": "xiaomi/mimo-v2.5"}should usemimo-v2.5.Actual: It falls back to the default
xiaoimi/mimo-v2.5-pro.Root Cause
Two compounding bugs in the ACP spawn → AcpxRuntime code path:
Bug 1: ACP spawn does not resolve agent model from config
openclaw-toolsreadsmodelonly from thesessions_spawntool call arguments. When the calling agent does not explicitly passmodel, it isundefined. The subagent spawn path hasresolveSubagentSpawnModelSelectionwhich correctly resolvesagent.model.primaryfrom config, but the ACP spawn path has no equivalent.File:
dist/openclaw-tools-*.js(sessions_spawn tool)File:
dist/acp-spawn-*.js(line ~821)cfgandtargetAgentIdare both available in the ACP spawn function, so the agent config could be resolved here.Bug 2: AcpxRuntime.ensureSession drops
input.modelEven when a model IS passed through the ACP Session Manager (which correctly extracts
requestedModeland passes it asmodel: requestedModeltoruntime.ensureSession()), the AcpxRuntime'sensureSessionignoresinput.modeland passessessionOptions: input.sessionOptions(alwaysundefined) to the inner AcpxManager.File:
dist/runtime-*.js(line ~6109-6121)The
AcpRuntimeEnsureInputtype hasmodel?: stringbut nosessionOptionsfield, soinput.sessionOptionsis alwaysundefinedandinput.modelis never forwarded.The inner AcpxManager reads
input.sessionOptions?.modelwhich is alwaysundefined, soapplyRequestedModelIfAdvertisedreturnsfalseand the process launches with the default model.Full trace for agent "claude3"
sessions_spawn(agentId: "claude3", runtime: "acp", task: "...")without explicitmodelmodelOverride = undefined(tool args only)spawnAcpDirect({ model: undefined })runtimeOptions = void 0(all three fields falsy)requestedModel = undefinedruntime.ensureSession({ ... })— nomodelfield includedsessionOptions: input.sessionOptions=undefinedinput.sessionOptions?.model=undefinedapplyRequestedModelIfAdvertisedreceives no model → returnsfalseProposed fix
Two changes needed:
1.
dist/acp-spawn-*.js(~line 1100): Auto-resolve agent model from config when not explicitly provided:2.
dist/runtime-*.js(~line 6120): Mapinput.modeltosessionOptions.model:Environment