Repository navigation
refactor(commands): deslop commands fourth pass - #158940
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 28, 2026, 1:57 AM ET / 05:57 UTC (Revision 20). ClawSweeper reviewWhat this changesThe branch consolidates CLI, Doctor, setup, backup, and channel command helpers and adjusts Gateway transcript reads during unrelated registry refreshes. Merge readiness⛔ Blocked before merge - 4 items remain This PR still contains distinct command cleanup absent from current main. The earlier review’s upgrade-proof concern is addressed by the recorded published-updater and Doctor/Workshop run; the separately reviewed Gateway prerequisite remains open. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw commands turn operator CLI requests into setup, repair, and status actions that can read or update configuration and stored state. The Gateway transcript reader serves session-history requests from that state. flowchart LR
A[CLI request] --> B[Command handlers]
B --> C[Doctor and setup]
C --> D[Config and state]
B --> E[CLI output]
F[History request] --> G[Gateway transcript reader]
D --> G
G --> H[Session history]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one owner for each command and migration operation while preserving existing CLI output, stored-state recovery, and primary transcript authority. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a refactor rather than a reported defect. The PR records direct CLI, Doctor, update, and Gateway-boundary comparisons for behavior preservation. Is this the best way to solve the issue? Yes: the sampled changes reuse existing owners and retain explicit primary transcript checks. The separate Gateway fix should land first as requested. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1fe560c198c2. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (19 earlier review cycles; latest 8 shown)
|
62a354f to
416a42f
Compare
f26bac0 to
2e7fc90
Compare
2e7fc90 to
4964d58
Compare
4964d58 to
de4bb73
Compare
de4bb73 to
5dc5825
Compare
9a108b1 to
3d6ccfd
Compare
Prepare auxiliary store discovery only for history views that consume cross-store lineage. Preserve primary authority and cleanup checks for every request, and dispose Talk test resources even when publication rejects.
Consolidate migration traversal, command result projection, and canonical helper use. Remove forwarding layers with complete caller and mock cutovers while preserving CLI, Doctor, auth, and configuration contracts.
Keep the original session-store error construction so cause formatting cannot change CLI messages. Remove shadowed locals and simplify the partial mock without dropping assertions.
3d6ccfd to
f6dd976
Compare
* fix(gateway): keep transcript reads available during registry refresh Prepare auxiliary store discovery only for history views that consume cross-store lineage. Preserve primary authority and cleanup checks for every request, and dispose Talk test resources even when publication rejects. * fix(gateway): retain primary file identity through history delivery * test(gateway): gate broadcasts on primary history replies * refactor(commands): deslop commands fourth pass Consolidate migration traversal, command result projection, and canonical helper use. Remove forwarding layers with complete caller and mock cutovers while preserving CLI, Doctor, auth, and configuration contracts. * chore(commands): shrink removed assertion baselines * refactor(commands): finish unused export cutover * refactor(commands): preserve output through final cleanup Keep the original session-store error construction so cause formatting cannot change CLI messages. Remove shadowed locals and simplify the partial mock without dropping assertions. * refactor(commands): complete wizard auth type cutover
Related: #156931, #156622, #158487
Depends on #159208. READY-TO-LAND after the Gateway prerequisite. Both PRs target main and remain open and unarmed; land Gateway first.
What Problem This Solves
The fourth cleanup pass over
src/commandsremoves repeated traversal, result projection, local types, and forwarding layers that make command behavior harder to maintain.User Impact
No intended user-visible change. Command names, flags, help, exit codes, JSON shapes, stdout/stderr routing, prompts, credential handling, config keys, and Doctor findings/repair ordering remain unchanged. No schema, migration policy, retention, permission, dependency, or publication change.
Why This Change Was Made
The sweep read the entire command subtree, starting with the largest files untouched by earlier passes. The commands-only range removes 1,515 net production lines across 123 files through existing owners:
Evidence
Head:
f6dd976b4ca4de66b4076322f5bfc9dfc0d299b3. Independent review has no accepted/actionable P0–P2 finding. Exact-head CI passed: 158 successful jobs, 20 skipped.Final Blacksmith Testbox proof uses that green CI run's exact merge
4f8b8638d269891427f0b7e4bbacad92cac464b6, treecf167c0485b9bf16941042a466edb9b3d6e9997d, against its main parent66679bfa3ec1ec7bd360ad6af5a3a0c269d6bdcd. The merge's second parent is the PR head above, and its stable patch ID matches the reviewed branch. All 50,207 tracked files were verified against their committed bytes and modes.Provider:
blacksmith-testbox; completed leasetbx_01m3jzxt3evb7j4511jf2zrgmk; proof runner. Commands run throughnode scripts/crabbox-wrapper.mjswith frozen dependency installation:node scripts/run-vitest.mjs: 24 affected files passed (125s), nine cross-shard files passed (39s), nine Gateway history files passed (84s), integration files passed (23s), Doctor overlaps passed (41s), continuation cases passed (20s), and tool-search migration passed (15s). The earlier 193-file/eight-shard run remains retained proof for unchanged cleanup patches.node scripts/check-changed.mjs --base 66679bfa3ec1ec7bd360ad6af5a3a0c269d6bdcd: all non-lint phases passed, including every production/test type graph and all three dead-export scans. Its sole failure was an unchanged main UI file above the line limit; fix(ci): keep chat attachment controls within lint limit #160159 repaired that owner. All five core lint stripes then passed (341s), and targeted UI changed checks passed (448s), completing the affected gate coverage.pnpm build: candidate passed (429s), comparison base passed (394s). Canonical candidate packaging and integrity checks passed (61s).pnpm openclawinvocations: all 44 help surfaces matched raw stdout/stderr/exit bytes; 90 invocations including isolated Doctor and Doctor/fix passed (107s). Four additional Doctor invocations also matched raw streams/exit codes and repaired seeded permissions. Saved config differed only inwizard.lastRunAt; each timestamp was validated inside its invocation, each saved-file hash was verified independently, and all remaining bytes/state matched. Both databases passed integrity/role checks.pnpm test:docker:published-upgrade-survivor, using published[email protected]andworkshop-doctor-recovery: passed (95s). It exercises malformed-state refusal, baseline Doctor repair, the installed published updater installing candidate bytes, Workshop migration, and candidate Doctor repair. Manual restart mode (--no-restart) leaves service-restart coverage outside this proof.Added resolver ordering/projection cases took 2ms and 1ms; their 11-case file took 17.56s wall with one worker. The moved locale-title case took 200ms; its five-case setup file took 15.31s wall. Existing CSS size advisories appeared equally in both builds, below the hard ceiling.
Fixes Found Along the Way
Canonical-owner mock cutovers, orphan internal exports, shadowed locals, and an import through a removed barrel were corrected. Session-store error construction remains unchanged to preserve CLI text. Assertion baselines only shrink. The Gateway transcript-read race is isolated in the prerequisite PR.
Captured unrelated failures were resolved through their existing upstream owners: #159964 repairs the installer smoke assertion, and #160015 includes the already-required Undici peer in fresh npm installs. The latter was already in the green CI merge tested above; no duplicate repair PR or dependency-version change was added.
Two proof-harness mistakes were corrected without product edits: carrier commits require tree identity checks, and builds must be consumed before wrapper resync changes the carrier SHA. The original raw captures remain unchanged; timestamp-dependent saved state was verified structurally rather than claiming byte-identical timestamps.
The CI-only line-limit repair in #160159 is merged on main (
2e95cdba84c2b7f697123aa0561da3e454605d7e). It moves the unchanged image data-URL decoder into the existing image owner. The composed follow-up treeeec464830c40d65420a419a9753eed5fef85ebc3passed 34 existing attachment tests, full core lint, UI changed checks, and the UI build. No commands/Gateway patch changed; their earlier passing proof remains valid. Both deslop and Gateway PRs are left unmerged.