fix(agents): allow configless gateway rebind to activate standalone owner#111841
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 20, 2026, 2:53 PM ET / 18:53 UTC. Summary PR surface: Source +28, Tests +30. Total +58 across 3 files. Reproducibility: yes. in source and contributor evidence: a configless gateway with provider credentials, followed by Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Merge this narrow owner-lifecycle repair once the current head completes normal required checks, then let the linked canonical issue close through its merged fix. Do we have a high-confidence way to reproduce the issue? Yes in source and contributor evidence: a configless gateway with provider credentials, followed by Is this the best way to solve the issue? Yes. Reusing the same configured-owner identity/directory matching logic for the fallback is narrower and safer than suppressing all rebind failures or adding new configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4aaea7b07291. Label changesLabel justifications:
Evidence reviewedPR surface: Source +28, Tests +30. Total +58 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
Constrain the configless-gateway fallback in acquirePreparedModelRuntimeLease to only suppress the rebind error when the requesting runtime has no matching configured owner. Previously the predicate checked any configured owner in the process, so a mixed gateway (one configured agent + one configless runtime) would still throw and block configless Model Setup activation. - Extract findConfiguredOwnerCandidates and hasConfiguredOwnerMatching from rebindInputToCommittedConfiguredOwner so the fallback reuses the same identity/directory matching criteria. - Add regression test for a configless runtime activating standalone while another agent is configured. Fixes review feedback on openclaw#111841.
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(agents): allow configless gateway rebind to activate standalone owner This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Land-ready proof for exact head
Known proof gap: a separate Blacksmith Testbox lease was blocked by GitHub HTTP 429 during provisioning before tests executed. No code/test failure occurred; the exact-head hosted CI above is the merge gate used here. |
|
Merged via squash.
|
* origin/main: (24 commits) fix(agents): keep compaction on live session model (#95713) fix(plugin-sdk): guard provider catalog live URL parsing against malformed responses (#109986) chore(cli): drop dead classifiers and single-use wrappers left by fallback removal (#112191) feat(ui): expand the lobster pet's random universe (#112073) chore(ci): audit dependency fingerprint exports (#112190) fix(ui): preserve graphemes in provider icons (#109509) fix(ui): align settings search with navigation rows (#112172) fix(agents): allow configless gateway rebind to activate standalone owner (#111841) fix(secrets): register secret targets for installed-origin plugins (#104347) improve(ui): show real machine identity in the place picker (#112162) fix: webChat scrollback history is too limited — older assistant replies and tool outputs disappear when scrolling… (#104250) test(ui): run DOM-free suites in Node (#112031) feat(nodes): make computer.act eligibility capability-based for desktop nodes (#112107) fix(apps): harden mobile gateway and watch state fix(ci): restore Z.AI API Platform validation (#112171) fix(ui): prevent Logs controls from overlapping (#112170) fix #95291: message tool fails to deliver files/images on Feishu (400 volc-dcdn / write ECONNRESET) while same Lark SDK upload succeeds standalone (#95514) refactor(cli)!: remove automatic gateway→embedded fallback from openclaw agent (#112074) refactor: move provider transports into packages/ai behind a typed host port (#111669) fix(anthropic): complete transcript reverse-scan windows across short reads (#109431) ...
…wner (openclaw#111841) * fix(agents): allow configless gateway rebind to activate standalone owner * fix(agents): allow configless gateway rebind to activate standalone owner * fix(agents): match configured owner before configless rebind fallback Constrain the configless-gateway fallback in acquirePreparedModelRuntimeLease to only suppress the rebind error when the requesting runtime has no matching configured owner. Previously the predicate checked any configured owner in the process, so a mixed gateway (one configured agent + one configless runtime) would still throw and block configless Model Setup activation. - Extract findConfiguredOwnerCandidates and hasConfiguredOwnerMatching from rebindInputToCommittedConfiguredOwner so the fallback reuses the same identity/directory matching criteria. - Add regression test for a configless runtime activating standalone while another agent is configured. Fixes review feedback on openclaw#111841. * fix(agents): scope configless setup runtime fallback --------- Co-authored-by: Patrick Erichsen <[email protected]>
Fixes #111520
What Problem This Solves
Fixes an issue where operator admins on a configless gateway (no explicit model in
openclaw.json, model resolved from a provider env key likeOPENAI_API_KEY) are permanently stuck on the Control UI Model Setup page. Clicking "Test & use" fails with:Because activation never commits,
openclaw.setup.detectkeeps returningsetupComplete: false, so every admin device is bounced to/settings/model-setup?firstRun=1from the default chat landing. On a multi-user trusted-proxy gateway this locks all admins out of the chat UI.The only workaround is host-side CLI (
openclaw models set openai/gpt-5.6-sol+ gateway restart), which regular Control UI users cannot perform.Why This Change Was Made
acquirePreparedModelRuntimeLeaseunconditionally callsrebindInputToCommittedConfiguredOwnerwhen the gateway lifecycle is active and the requesting path hasprovenance: "run". On a configless gateway, noprovenance: "configured"owner exists, so rebind throwsPreparedModelRuntimeOwnerNotPublishedErrorwith no fallback.The sibling path
loadPreparedModelRuntimeSnapshotalready handles this by catching the same error and falling through toactivateStandalonePreparedModelRuntime. This change adds a parallel guard inacquirePreparedModelRuntimeLease: catch the error, verify the requesting runtime has no matching configured owner (to preserve the error for stale-owner refresh), then let the raw input proceed to standalone lease publication.The fallback predicate was refined from "any configured owner exists in the process" to "a configured owner matches this runtime's identity/directory", so a mixed gateway (one configured agent + one configless runtime) no longer incorrectly blocks the configless runtime.
User Impact
Operator admins on configless gateways can now complete Model Setup "Test & use" directly through the Control UI without host-side CLI intervention. The setup flow detects the provider-derived model, live-tests it, persists the config, and marks setup complete — all from the browser.
Evidence
Before fix
Gateway with empty
openclaw.json,OPENAI_API_KEYset via env. Model Setup "Test & use" → error:setup.detectcontinues reportingsetupComplete: false, redirect loop persists.After fix — real gateway proof
Started a clean-state gateway with no
openclaw.jsonand a fakeOPENAI_API_KEY:Gateway resolved the default model from the env key and became ready:
openclaw.setup.detectfound the OpenAI API-key candidate:node openclaw.mjs gateway call --url ws://127.0.0.1:18790 --token proof-token-111841 --json \ openclaw.setup.detect --params '{}'{ "candidates": [ { "kind": "openai-api-key", "modelRef": "openai/gpt-5.6", "credentials": true } ], "setupComplete": false }openclaw.setup.activate(Model Setup "Test & use") proceeded past prepared-runtime activation and reached the provider call instead of failing with the lifecycle error:node openclaw.mjs gateway call --url ws://127.0.0.1:18790 --token proof-token-111841 --json --timeout 60000 \ openclaw.setup.activate --params '{"kind":"openai-api-key"}'{ "ok": false, "status": "auth", "error": "403 Country, region, or territory not supported" }The request did not fail with
prepared model runtime owner was not committed after replacement; it failed only at the provider auth step, which is expected with a fake/redacted key and confirms the configless runtime activated successfully.Unit tests
Includes a new regression test: a configless runtime activates standalone while another agent is configured.