Repository navigation
refactor(cli): make multi-agent operations agent-owned - #123871
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 19, 2026, 10:41 PM ET / August 20, 2026, 02:41 UTC. ClawSweeper reviewWhat this changesThe PR routes multi-agent CLI model/auth setup, channel setup discovery, and local capability commands through an operation-specific agent owner and preserves list-form agent rosters during model writes. Merge readiness⛔ Blocked until stronger real behavior proof is added - 6 items remain Keep open: the PR has useful exact-head CLI proof for model configuration, but interactive channel setup still resolves its workspace through the ambient owner, not the new operation-owner rule. That can split a migrated legacy fleet’s channel discovery and setup across different agents. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherCLI setup selects an agent whose workspace, auth profiles, and model policy should receive the operation. Channel setup then discovers plugins and configures accounts using that workspace, so all stages must use the same owner. flowchart TD
A[CLI setup command] --> B[Operation owner selection]
B --> C[Selected agent workspace]
B --> D[Selected agent auth and model state]
A --> E[Channel setup wizard]
E --> F[Plugin discovery and setup flow]
F --> G[Channel configuration]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +117, Tests +356. Total +473 across 14 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Thread the resolved operation owner or workspace through the complete interactive channel setup flow, cover the legacy-owner-plus-System-Agent case, then publish redacted exact-head channel and capability proof. Do we have a high-confidence way to reproduce the issue? Yes, from source: use a non-explicit migrated legacy roster with retained owner ops and a configured System Agent main; the operation resolver selects ops while the interactive setup flow selects main’s workspace. Is this the best way to solve the issue? No. The shared channel setup flow must receive the same operation owner rather than independently resolving an ambient owner after the wizard has selected one. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 29cfd195d19d. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What 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
HistoryReview history (42 earlier review cycles; latest 8 shown)
|
8ca5723 to
866422d
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
866422d to
85ad2b9
Compare
|
Current-main supersedure check and exact-head proof update:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
85ad2b9 to
4e6a1d4
Compare
|
Correction to the prior proof note: the contributor branch was automatically rebased while review was running.
The earlier |
|
@clawsweeper re-review Fresh exact-head behavior proof is now recorded in the PR body for |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Recreated the real-behavior proof on the literal current PR head
I updated the PR Evidence section with the redacted fixture and selected JSON output. @clawsweeper re-review |
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Please review the literal current head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Addressed the three P1 findings at exact head
Exact-head proof: 8 focused files, 108 tests passed; core typecheck and formatting passed. The PR body contains the redacted behavior assertions. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Addressed the latest compatibility findings at exact head
Exact-head terminal proof is now in the PR body: core typecheck passed and the focused suite passed 224/224 tests. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Exact-head real-behavior proof is now in the PR body for
The body records the commands, redacted outcomes, run links, environment boundary, and remaining conflict/CI gap. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Exact-head repair and behavior proof for The two P1 findings from the review of
Verification:
The body records the baseline failure, exact commands, environment boundary, dependency contract, results, and LOC split. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Addressed the exact-head list-roster P1 at Root cause: both targeted model mutation paths read Verification:
The PR body now contains the exact-head results and updated production/test deltas. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
Related: #112735
What Problem This Solves
Fixes an issue where multi-agent CLI setup could route through the wrong agent or lose the retained owner of a migrated legacy roster. Configure auth/model writes, channel setup, and local capability commands could therefore read or write the wrong workspace, auth store, or model policy—or fail as ownerless even though migration had preserved an owner.
Why This Change Was Made
The change establishes one operation-owner rule for these CLI paths:
--agent;default: truemarker is normalized away;Model pickers keep their existing defaults-based APIs. Their results are projected onto the selected agent entry so provider integrations remain unchanged. Custom-provider setup preserves its root
models.providersmutation while moving only model/default state onto the selected agent.The current head also addresses the latest ClawSweeper findings:
codex/<model>primaries are canonicalized from the selected agent entry toopenai/<model>before its allowlist is updated.User Impact
Operators can run multi-agent CLI setup without silently placing credentials or model configuration on another agent. Migrated legacy configurations keep their selected owner, and explicit agents cannot retain a legacy Codex primary that falls outside their newly selected OpenAI allowlist.
Evidence
Exact pushed head:
7145e319f9333c95050a237a484b4550e43f1543.Before: baseline reproduces the owner-loss failure
run_950161a3b9b34994f7bacf308269a0770b4a912c44a746cccec7pnpm openclaw configure --section modelmain/opsfleet with a configured System Agent.Multiple agents are configured, but this operation has no explicit owner; global,main, andopsmodel state remained unchanged.After: exact-head real CLI behavior
run_5ec01bee2b65pnpm openclaw configure --section modelPTY flow twice.openai/gpt-5.6-lunacanonically preserved exactly themainandopsentries, removed the internal list projection, and changed onlyagents.entries.ops.model; global defaults andmainremained unchanged.opsowner was selected and onlyagents.entries.ops.modelchanged; global defaults andmainremained unchanged.No provider credential, external API, or external channel was used or claimed; this proof exercises the credential-free production CLI ownership path.
Focused and changed-surface verification
node scripts/run-vitest.mjs src/commands/onboard-agent-target.test.ts src/commands/onboard-custom-config.test.ts src/commands/configure.gateway-auth.prompt-auth-config.test.ts src/agents/agent-scope-config.test.tsnode scripts/check-changed.mjs --: passed all changed formatting, typecheck, lint, export, boundary, import-cycle, and database guards.git diff --check origin/main..HEAD: passed.codex/gpt-5.5becomesopenai/gpt-5.5on that agent before its allowlist is projected; global defaults remain unchanged.Dependency contract
Direct sibling Codex inspection confirms
openaiis the canonical provider ID and built-in provider-map key in../codex/codex-rs/model-provider-info/src/lib.rs; Codex configuration also defaults provider selection toopenai.Review and size
+166/-49. Tests:+357/-1against the reviewed base. The final list-roster repair itself is production+40/-36(net+4) and tests+94/-0.Current Review State
c2eb109b133and the list-form roster P1 from the review of81557e239dabare repaired on the exact head above.