Repository navigation
docs(mxc): isolate test setup and cleanup - #118945
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 25, 2026, 10:11 PM ET / August 26, 2026, 02:11 UTC. ClawSweeper reviewWhat this changesThe PR rewrites MXC test setup and cleanup instructions to use a dedicated agent and scoped plugin configuration instead of replacing all configured agents. Merge readiness⛔ Blocked until real behavior proof is added - 5 items remain This PR remains necessary: current main still documents roster-replacing MXC setup and cleanup. Its dedicated-agent approach is sound, but the PowerShell example must stop after a failed agent creation and the contributor must provide inspectable exact-head behavior proof before merge. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe MXC plugin README guides operators through creating a test agent, applying sandbox and plugin configuration, and removing that setup. These commands persist agent and plugin configuration, so the flow must retain unrelated agents and settings. flowchart LR
A[Operator follows MXC README] --> B[Create MXC test agent]
B --> C[Apply scoped configuration]
C --> D[Run MXC test]
D --> E[Delete test agent]
E --> F[Preserve other agents and settings]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceDocs -47. Total -47 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the dedicated-agent workflow, add explicit fail-fast handling after agent creation, and prove both failed creation safety and successful non-destructive cleanup on the PR head. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: agent creation exits nonzero when mxc-test already exists, while the PowerShell example continues into a scoped patch and cleanup. Is this the best way to solve the issue? No: the dedicated-agent design is the best direction, but it needs explicit native-command failure handling before it is safe documentation. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c841a9958abc. 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 (8 earlier review cycles)
|
Co-authored-by: Copilot <[email protected]> Copilot-Session: d7253887-71c9-4083-a591-91979c981e39
Co-authored-by: Copilot <[email protected]> Copilot-Session: d7253887-71c9-4083-a591-91979c981e39
The Cleanup section replaced the entire agents.list with a single default main entry, which would silently drop any other agents a user had configured. Mirror the non-destructive approach now used in Test setup: 'openclaw agents delete mxc-test --force' plus a plugin-only config patch. Co-authored-by: Copilot <[email protected]> Copilot-Session: d7253887-71c9-4083-a591-91979c981e39
6998ea6 to
16728a7
Compare
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
I hit one documentation correctness blocker in final validation.
Please restore the prior wording: The non-destructive workflow itself is validated. Blacksmith Testbox I restored draft status because this row is operator-facing and currently inaccurate. Once it is corrected, the exact-head review and CI lane can be refreshed. |
An unset timeoutSeconds resolves to the 300s sandbox baseline, not the internal 120 value, since timeoutSecondsConfigured stays unset. Co-authored-by: Copilot <[email protected]>
|
Thanks for catching this. Restored the The effective unset behavior is source-backed: I also verified the revised SDK argv wording against upstream TypeScript at tag and So the argv-exposure note is accurate as written. I also re-audited the rest of the README against current |
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Use a uniquely owned test agent and freshly reserved workspace, stop after failed native commands, and leave installation-wide MXC configuration and policy untouched. Preserve the effective unset timeout and existing SDK transport wording. Co-authored-by: Paul Campbell <[email protected]>
|
Maintainer follow-through on Paul's existing PR: pushed 7a5cc0048026, preserving the contributor commits and credit. The README now reserves a unique workspace, creates a unique agent, checks each native exit, and leaves shared MXC configuration/policy untouched. Cleanup requires successful creation in the same session. The real PowerShell/current-main CLI probe reproduced the previous failed-add continuation modifying an existing agent. All five revised-flow scenarios pass: success/cleanup, duplicate-agent rejection, existing-workspace rejection, failed dry-run, and failed apply after a successful dry-run. Existing agents, binding, workspace sentinels, and nondefault plugin configuration were preserved. README SHA-256: Exact-head CI is green, including I also corrected the original premise: on current main's canonical roster, the old legacy-list patch was accepted without applying the requested sandbox settings, rather than deleting the other agents. General legacy roster-patch acceptance semantics remain a named follow-up outside this documentation fix. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* docs(mxc): correct timeout default Co-authored-by: Copilot <[email protected]> Copilot-Session: d7253887-71c9-4083-a591-91979c981e39 * docs(mxc): preserve existing agents in setup Co-authored-by: Copilot <[email protected]> Copilot-Session: d7253887-71c9-4083-a591-91979c981e39 * docs(mxc): make cleanup non-destructive The Cleanup section replaced the entire agents.list with a single default main entry, which would silently drop any other agents a user had configured. Mirror the non-destructive approach now used in Test setup: 'openclaw agents delete mxc-test --force' plus a plugin-only config patch. Co-authored-by: Copilot <[email protected]> Copilot-Session: d7253887-71c9-4083-a591-91979c981e39 * docs(mxc): restore effective timeoutSeconds default An unset timeoutSeconds resolves to the 300s sandbox baseline, not the internal 120 value, since timeoutSecondsConfigured stays unset. Co-authored-by: Copilot <[email protected]> * docs(mxc): keep test setup and cleanup isolated Use a uniquely owned test agent and freshly reserved workspace, stop after failed native commands, and leave installation-wide MXC configuration and policy untouched. Preserve the effective unset timeout and existing SDK transport wording. Co-authored-by: Paul Campbell <[email protected]> --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Copilot-Session: d7253887-71c9-4083-a591-91979c981e39
What Problem This Solves
Fixes an issue where operators following the MXC test guide could modify an existing test agent or shared plugin settings instead of isolating their test. The proposed fixed-name
agents addcould fail and PowerShell would continue into the patch; cleanup could then delete that existing agent. Both the old guide and the initial PR also overwrite installation-wide policy and remove the whole MXC plugin entry during cleanup.Current-main qualification: on
9bd50c803cce88f2ab387ddaf6cc29b4ef004005, the oldagents.listpatch is accepted but leaves an existing canonicalagents.entriesroster unchanged, including the requested sandbox settings. The original claim of current-main roster destruction is not supported by this reproduction. The guide is still broken, and the failed-create/shared-policy hazards remain real.Why This Change Was Made
Keep Paul Campbell's dedicated-agent approach, but give the example a generated agent ID and reserve a fresh workspace before creating it. Check each native exit immediately, patch only that agent's sandbox settings, and permit cleanup only after successful creation in the same PowerShell session. Use the canonical agent-delete command; do not remove shared plugin configuration or policy files.
The example requires an existing configured installation with MXC already installed and enabled. It deliberately inherits the installation's existing policy. This avoids a second test-specific plugin configuration or profile that would lose the operator's existing setup. Cleanup documents partial filesystem failures instead of promising that a successful configuration deletion removed every directory.
The effective unset timeout remains the existing 300-second baseline. The SDK transport note is unchanged from main. The test-command wording no longer claims two different runners are equivalent.
User Impact
Operators can set up and remove a temporary MXC test agent without altering other agents, reusing an existing workspace, or changing policy for other MXC users. No runtime code, schema, config option, timeout, or sandbox permission changes.
Release-note context: MXC test setup now uses a uniquely owned agent and workspace, stops on failed commands, and preserves existing agents and shared plugin policy. Thanks @paulcam206.
Evidence
Reviewed README SHA-256:
82dceb0b965f0790c5ac85a7c77deda8885f7db031720d84a24549f2de63e970(head7a5cc00480262a2c5ece2951d685d298556c0712).Real before/after observations:
All five revised-flow cases completed successfully, including invalid dry-run and failed application after a successful dry-run. Both failure paths left the new agent unconfigured and permitted scoped cleanup while preserving existing state. Exact-head CI run 33078686540 completed successfully, including
check-docsandopenclaw/ci-gate.Independent source review and isolated Codex autoreview found no actionable findings.
git diff --checkand standaloneoxfmt --check extensions/mxc/README.mdpassed. The dependency-less PR worktree's formatting hook refused to run; the commit used the separately verified trusted formatter result. CI and native landing gates remain required. No dependency install or contributor executable was used for the behavior proof.Proof scope: real PowerShell 7.6.3 and the built trusted-main CLI on macOS, with isolated configuration/state, an unused loopback port, multiple existing agents, a routing binding, workspace sentinels, and nondefault MXC configuration. The final README blocks are extracted and executed directly for the success case. Failure cases change only the collision input or inject an invalid sandbox mode before validation/application; native CLI commands are not mocked.
This proves shell control flow and configuration/cleanup ownership, not Windows ProcessContainer execution. MXC is disabled in the proof fixture because the host is macOS; no inference, provider calls, real Gateway, or operator state is used. The no-Gateway fixture prints a cron-cleanup warning (it contains no scheduled jobs); this is not presented as verified cron cleanup. Windows backend execution is outside this documentation-only repair. One earlier multi-command harness run timed out under heavy host load and is excluded from passing evidence; completed multi-command runs use a proportionate harness allowance without changing any product timeout.
Source map: CLI registration and agent add/delete commands;
src/agents/agent-create.tsduplicate ownership;src/agents/agent-scope-config.tsroster precedence;src/commands/agents.config.tsscoped pruning; workspace creation and deletion safety; config patch operations and writer roster guards; MXC plugin registration, backend factory, timeout resolution, and policy ownership. The generic legacy roster-patch acceptance behavior is a named follow-up, not a runtime change in this PR.Production LOC: +0/-0. Tests: +0/-0. Documentation: +37/-103. No synthetic README-string test was added: the executable PowerShell scenarios exercise the operator-visible contract directly.
Both latest ClawSweeper rank-up moves are addressed by fail-fast handling and the before/after preservation proof. The added SDK-argument wording was dropped, so the dependency-specific addition is no longer part of the patch.