Repository navigation
fix(cli): honor explicit system agent in configure - #125377
Patrick-Erichsen merged 10 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 2:42 AM ET / 06:42 UTC. ClawSweeper reviewWhat this changesThe PR makes Configure persist a workspace on the configured system-agent entry for explicit fleets, while retaining legacy roster workspace ownership and original agent-key casing. Merge readinessKeep open. Current main still resolves Configure through the generic legacy/sole-agent path, while this PR explicitly separates explicit-fleet system-agent ownership from legacy ownership and preserves authored entry-key casing; no blocking patch defect found. Priority: P1 Review scores
Verification
How this fits togetherConfigure is OpenClaw’s interactive CLI for editing the agent roster and workspace settings. Its selected ownership target controls the workspace later used for provisioning, plugins, and skills. flowchart LR
A[Configure workspace input] --> B[Load agent roster]
B --> C{Explicit fleet?}
C -->|Yes| D[Configured system agent]
C -->|No| E[Retained legacy owner]
D --> F[Persist selected workspace]
E --> F
F --> G[Provision plugins skills and workspace]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +19, Tests +232. Total +251 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the owner-boundary repair after exact-head checks complete, retaining the explicit-versus-legacy split because no smaller canonical path preserves both workspace contracts and authored keys. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main’s Configure target path does not consult the system-agent setting, while the explicit-roster fixture in the PR exercises the affected ownership shape; this read-only review did not execute the CLI. Is this the best way to solve the issue? Yes. The fix changes the Configure ownership producer, preserves the legacy migration marker at derived-config boundaries, and avoids a downstream workspace workaround. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 540ea124e09a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
e517acb to
833f786
Compare
833f786 to
d8ff580
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@clawsweeper re-review Current head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Patrick-Erichsen
left a comment
There was a problem hiding this comment.
Approved at 6e9a9ef after two bounded compatibility repairs: explicit fleets keep System Agent workspace ownership, while migrated legacy rosters retain their existing owner.
Proof: 9 focused tests passed, explicit and legacy configure terminal journeys passed, and fresh autoreview found no actionable issues. Waiting only on final-head hosted CI and exact ClawSweeper gates before landing.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Patrick-Erichsen
left a comment
There was a problem hiding this comment.
Approved at 6e9a9ef5a0ab10d7aa702b2bebec363c2787cb6c.
The configure wizard now honors explicit System Agent ownership while preserving migrated legacy workspace ownership. Sanitized exact-tree AWS proof passed 9 focused tests plus both explicit and legacy PTY journeys (run_ddbfd910cb7d), and fresh exact-head autoreview reported no actionable findings. Remaining gates are hosted CI, exact-head ClawSweeper, and the native prepare/merge checks.
Patrick-Erichsen
left a comment
There was a problem hiding this comment.
Approved at exact head 949210a.
The final configure-only repair honors the explicit System Agent while preserving migrated legacy workspace ownership through the existing sidecar inheritance contract. Exact-tree proof passed 9 focused tests, the full test-type gate, formatting, and built-CLI PTY journeys for both explicit and legacy configurations; fresh autoreview and independent verification are clean. Remaining gates are exact-head hosted CI, refreshed ClawSweeper, resolved threads, and native prepare/merge checks.
|
@clawsweeper re-review Final reviewed head is |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* fix(cli): honor explicit system agent in configure * fix(cli): persist explicit agent workspace * fix(cli): preserve authored agent key casing * fix(cli): preserve configured system agent key * fix(configure): preserve legacy onboarding owner * fix(configure): preserve workspace ownership semantics * fix(configure): retain migrated legacy owner * fix(configure): retain legacy owner marker --------- Co-authored-by: Patrick Erichsen <[email protected]>
What Problem This Solves
The configure wizard could persist a selected workspace to
agents.defaults.workspaceeven when an explicit system agent entry already existed without its own workspace field.Why This Change Was Made
Workspace ownership now follows the resolved system agent whenever that entry exists. The wizard updates
agents.entries.<agentId>.workspaceinstead of silently changing the global default, including for an existing entry whose workspace was previously omitted.User Impact
Running configure with an explicit multi-agent roster updates the configured system agent’s workspace and preserves the global default for other agents.
Evidence
e517acbac6e139b44daae1cafc9ea4094a11491dopenclaw configure --section workspace; an explicitmainentry receivedagents.entries.main.workspacewhileagents.defaults.workspaceremained unchanged.No production config was changed and no proof artifact is committed. Maintainer review and sponsorship remain separate decisions.
Exact-head proof (2026-08-17)
e517acbac6e139b44daae1cafc9ea4094a11491dOPENCLAW_STATE_DIRandOPENCLAW_CONFIG_PATHpointed to a temporary directory.agents.defaults.workspace=/tmp/global-workspace;agents.entries.main.workspace=/tmp/global-workspace(inherited).pnpm exec tsx src/index.ts configure --section workspaceWorkspace OK;Updated config: .../openclaw.json; exit 0.agents.defaults.workspaceremained/tmp/global-workspace; the explicitmainentry received the newly selected workspace. No production config was touched.Final exact-head correction (2026-08-17)
The earlier proof section is superseded by the final rebase. Literal pushed head is
833f786f32af3b283d72a599163e21e2f094fb35, based on currentorigin/mainbb03085015e94f78714e4f8fc549f8e231b815e1. Final focused validation: 2 files, 5 tests passed. The disposable-state CLI transcript and before/after ownership fields above apply to the unchanged patch behavior.Final synchronized head (2026-08-17)
Final literal pushed head:
d8ff580d721440bb1c11dc3de01957ae9a103da4; base:6938026f20457bd166ea02e040979398b06b2715. Final focused validation: 2 files, 5 tests passed. The disposable-state CLI proof above remains applicable to the unchanged patch behavior.Inspectable exact-head CLI transcript
Head:
d8ff580d721440bb1c11dc3de01957ae9a103da4This was run against a disposable
OPENCLAW_STATE_DIRandOPENCLAW_CONFIG_PATHwith an explicit roster andagents.defaults.systemAgent.agentId=main:The resulting config was re-read from the disposable state directory after the command; the proof is limited to the workspace section.
Final exact-head correction: authored key casing and persisted fields
Final head:
52982421b6c2f20cc19b3c91fa2e0fa3d54a6a8d(verify with the PR head field).The onboarding mutation now resolves the authored
agents.entrieskey by normalized agent ID and writes back through the original key, so an authoredMAINentry is preserved instead of creating a second lowercasemainentry. Focused tests: 6 passed acrossconfigure.wizard.default-agent.test.tsandonboard-agent-target.test.ts, including the uppercase-key regression.Inspectable disposable CLI result:
The disposable state directory was re-read after the command; the global default remained unchanged and the authored system-agent entry received the workspace.
Correct final head hash:
52982421b6c16d4e6c3d5df830cac275a2901875.Final exact-head correction: configure key preservation
Final head:
300174f2b78b2b3ce44e4ab1d42b4f57541640fc(verify with the PR head field).The first casing fix covered model mutation but the wizard workspace mutation had a separate direct lowercase lookup. That path is now fixed too: configure resolves the authored
agents.entrieskey by normalized ID and writes the workspace back through the original key. The explicit-system-agent regression test now uses authoredMAINwith configuredmainand passes; the focused suite is 6/6.Correct final head hash:
300174f2b785d3ab6d642b49fcf2dd05e89f28ca.Current-main ancestry and final proof (2026-08-17)
Final literal PR head:
4cefd3b4114f6a33a14bc417c7e3497340a14264. This head is a merge commit whose first parent is the prior PR head and whose second parent is currentmainaebe360349aef1c6ec4e4e67c5e81050c4a07728. The nine current-main commits touched no files in this PR, so the tested PR behavior is unchanged by the ancestry-only update.Focused configure/onboarding tests: 2 files, 6 tests passed on the PR code before the ancestry-only merge, including authored
MAINkey preservation. No current-main commit touched the four PR files. The final TTY capture attempt was not successful; unit/source proof is recorded.Exact-head validation update (2026-08-17)
4cefd3b4114f6a33a14bc417c7e3497340a14264: focused configure/onboarding suite passed, 2 files and 6 tests.OPENCLAW_STATE_DIR=/tmp/openclaw-proof-state pnpm openclaw configure --section workspacecompleted with “Workspace OK”, “Updated config”, and “Configuration updated.” The resulting config retained authored entry keyMAINand persisted its workspace path; defaults also remained synchronized.Maintainer P1 compatibility fix and exact-head proof (2026-08-17)
d29f9c479d128621199687e1a39964c9a2a693f1.agents.defaults.systemAgent.agentIdnow selects onboarding ownership only whenagents.ownershipis explicitly"explicit"; legacy rosters continue using their retained/default owner.opsdefault marker alongside amainsystem-agent setting. Focused configure/onboarding validation: 2 files, 7 tests passed.configure --section workspacecompleted withWorkspace OK,Updated config, andConfiguration updated; authoredMAINremained the persisted key.Current-base exact-head configure proof (2026-08-17)
c7183f4e583..., synchronized with currentorigin/mainbeebeac11d4260913af82b513596cadc13874f78.pnpm openclaw configure --section workspaceagainst a disposable config containing authored entry keyMAIN, explicit system agentmain, and a separate global default workspace.Workspace OK,Updated config, andConfiguration updated. The persisted config retained authored keyMAINand wrote the selected workspace under that entry, while leaving the global default workspace unchanged.