Repository navigation
fix(acp): pass configured agent model to ACP binding sessions - #120046
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
August 6, 2026 20:27
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
An ACP agent with an explicit model configured in
openclaw.json(model.primary) never receives that model: the configured-binding producer omitted it, soensureConfiguredAcpBindingSession()initialized the ACP session withoutruntimeOptions.model. The child process then inherits the gateway'sANTHROPIC_MODELenv var, which the ACP adapter reads with highest priority — silently overriding the agent's own configuration.Fixes #119551 (reported by @Enominera).
Why This Change Was Made
The fix follows the existing correct precedent in
src/agents/acp-spawn-runtime.tsand the repo's prepare-facts-once doctrine: the owner's explicit model is resolved once at the binding producer (resolveAgentExplicitModelPrimaryinacp-configured-binding-consumer.ts), persisted through the binding record, and passed asruntimeOptions.modelatinitializeSession(). Existing bound sessions with drifted models are patched in place viaupdateSessionRuntimeOptions— conversation state is preserved, and manual ACP model choices remain untouched when no explicit owner model is configured. No environment-passthrough, ACPX, protocol, or config-surface changes.User Impact
Configured ACP agent models are now authoritative. Operators no longer get a different model than the one they configured just because the gateway's environment carries
ANTHROPIC_MODEL.Evidence
origin/mainsource (not just the reporter's dist trace); restart, resume, failover, oneshot, and backend-neutral paths checked — they already replay persisted runtime options correctly.node scripts/run-vitest.mjs src/acp/persistent-bindings.lifecycle.test.ts src/acp/persistent-bindings.test.ts src/acp/control-plane/manager.initialize-session.test.ts src/acp/control-plane/manager.runtime-config-validation.test.ts— all pass.gpt-5.6-sol, high): clean, "patch is correct (0.99)".