fix(agents): honor ACP alias model.primary overrides (Fixes #87381)#87404
fix(agents): honor ACP alias model.primary overrides (Fixes #87381)#87404deepujain wants to merge 1 commit into
Conversation
|
Thanks for the context here. I did a careful shell check against current Close: current main and release v2026.6.6 already fix the ACP alias model propagation problem through #88946, and this branch is now a less safe merge candidate because it uses broader effective-model fallback semantics. So I’m closing this as already implemented rather than keeping a duplicate issue open. Review detailsBest possible solution: Keep the shipped v2026.6.6 implementation from #88946 and close this branch rather than reviving its broader fallback semantics. Do we have a high-confidence way to reproduce the issue? No for current main: the old source path is fixed by current main and shipped in v2026.6.6. The pre-fix issue was source-reproducible from ACP spawn passing only params.model and acpx requiring sessionOptions.model. Is this the best way to solve the issue? No, this branch is no longer the best way to solve the issue. Current main fixes the same user problem with the existing subagent/agent model-selection seam plus acpx sessionOptions mapping, avoiding the branch's broader global-default fallback. Security review: Security review cleared: The diff changes TypeScript ACP model-routing logic and tests only; it does not touch dependencies, workflows, secrets, install scripts, or package metadata. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 889bc52ba5b3; fix evidence: release v2026.6.6, commit bc78cd5f8ab6. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
Real Behavior ProofReproduced on macOS, Node v22, commit 1. Focused test suite (vitest)Test 1 — alias model resolution:
Test 2 — raw harness id isolation:
2. Standalone logic reproductionExtracted the core resolution logic from 3. Source-level walkthroughThe fix at const configuredAcpAliasId = resolveConfiguredAcpRuntimeAliasId({
requestedAgentId: params.agentId,
cfg,
});
const resolvedModel =
params.model ??
(configuredAcpAliasId
? resolveAgentEffectiveModelPrimary(cfg, configuredAcpAliasId)
: undefined);
Environment
|
|
@clawsweeper re-review |
|
@clawsweeper re-review Updated the PR body to include the current proof details already captured on-thread, including the focused vitest run and the direct alias-vs-raw-runtime behavior checks. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@deepujain thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Fixes #87381
When
sessions_spawn(runtime="acp")targets an OpenClaw agent alias backed byruntime.type="acp", ACP session initialization only forwarded an explicitmodelargument from the tool call. If the caller omittedmodel, the spawn path ignored the alias agent's configuredmodel.primary, even though the alias had already resolved to the correct ACP harness id.This patch keeps the fix narrow:
sessions_spawn.modelprecedenceagentIdis a configured ACP alias, fall back to that alias agent's effective model before initializing the ACP sessioncodexunchanged so unrelated ACP spawns do not start inheriting config from some other aliasI did not change the separate Claude startup-env/model-switch behavior discussed later on the issue. This PR only fixes the missing OpenClaw-side model routing on the ACP alias spawn path.
Tests and validation
node scripts/run-vitest.mjs src/agents/acp-spawn.test.tsgit diff --checkReal behavior proof
Behavior addressed:
model.Environment tested:
dbac0720Exact validation:
node scripts/run-vitest.mjs src/agents/acp-spawn.test.ts --reporter=verboseEvidence after the fix:
spawnAcpDirect > maps OpenClaw ACP runtime agent aliases to their configured harness idpasses while assertingruntimeOptions.model = "openai/gpt-5.5-mini"spawnAcpDirect > does not inherit configured alias model defaults for raw ACP harness idspasses while asserting raw harness-id spawns still leaveruntimeOptionsunsetObserved result:
What was not tested:
Proof limitation:
Risk
Low to medium. The patch only changes ACP spawn model fallback when the requested
agentIdis a configured OpenClaw ACP alias and no explicit model was supplied. Explicit model overrides still win, and raw external harness ids keep their previous behavior.