Repository navigation
refactor(commands): deslop commands, CLI, and infrastructure - #163840
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
|
Codex review: blocked before merge. Reviewed October 2, 2026, 7:28 PM ET / 23:28 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch consolidates repeated CLI, onboarding, Doctor repair, status reporting, pairing, and migration logic into shared owners while preserving existing behavior. Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this maintainer-authored cleanup remains distinct from current main. No actionable introduced defect was found, and the prior generic upgrade warning is not supported by the inspected changes. Exact-head CI remains unresolved. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw's command layer turns operator options and existing configuration into setup, diagnostics, and repairs. Shared infrastructure carries those operations through authorization, persistent state, and message routing. flowchart TD
A[Operator commands] --> B[CLI validation]
C[Existing configuration and state] --> D[Doctor and onboarding]
B --> D
D --> E[Shared infrastructure owners]
E --> F[Authorization and commit checks]
F --> G[State updates and message routing]
E --> H[Operator reports]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Use the shared owners while preserving existing command output, migration precedence, receipt handling, and commit-time authorization. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes behavior-preserving cleanup, and source review found no concrete introduced failure to reproduce. Is this the best way to solve the issue? Yes: consolidating equivalent operations into their existing owners is maintainable, and the inspected callers retain their validation, consent, and refusal contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 73fe145a1e6e. 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 (1 earlier review cycle)
|
…w#163840) ## What Problem This Solves Commands, Doctor, and infrastructure repeat option forwarding, migration traversal, result projection, and error handling that already have canonical owners. ## User Impact No intended user-visible change. CLI flags, messages, exit codes, JSON output, migration precedence, persisted data, and authorization checks stay unchanged. Supported July 2026-and-later migrations and the older-Gateway node-list fallback remain supported. ## Why This Change Was Made This combines the subsystem cleanup into one batch, removing 1,459 net production lines instead of paying for separate CI runs for each small simplification. - Consolidate onboarding installation, auth selection, migration item selection, and cleanup reporting; retain branch-specific consent and error behavior. - Reuse Doctor's model-slot traversal, parsing, package identification, report projection, and session-key collection instead of parallel implementations and forwarding helpers. - Let status reports consume their existing overview facts directly, and share archive/storage command registration. - Map device-pairing authority refusals at the mutation owner after admission and publication settle; preserve locks, revalidation, cleanup, and each caller's return shape. - Consolidate receipt-authoritative APNs/MCP source cleanup at the source-claim owner, keeping each migration's safe reader and receipt commit. - Remove redundant outbound target forwarding and reuse existing filesystem, normalization, and text helpers. Updater lifecycle, dependencies, schemas, and plugin SDK contracts are unchanged. The native assertion-baseline tool records five removed assertions; no allowance grows. No newly discovered product bugs or flaky-test fixes are included. ## Evidence - Both import-cycle checks passed again on the final rebased head: 0 Madge cycles and 0 runtime-value cycles. - AWS focused run: 3,324 passed, 2 skipped, and one inherited Doctor fixture failure across 174 files. The same failure reproduced on the clean base. The branch now includes the upstream repair from openclaw#163777; no duplicate fix is included. - The complete changed-file gate passed, including production/test types, lint, dead exports, boundaries, and ratchets. The final Gateway send rerun passed all 83 tests. Git range-diff confirms the rebase preserved the cleanup patch. - After the final Testbox exceeded the ten-minute queue limit, the local `nice -n 15` confirmation completed with 82 Gateway tests passing and one 120-second timeout in the Telegram live-owner test; Doctor did not run because the first group failed. Native worker compilation took 566 seconds under severe host load. The failure is recorded, not counted as passing proof. - Exact-head CI [37074925001](https://github.com/openclaw/openclaw/actions/runs/37074925001) passed types, lint, architecture, builds, Windows, and most test shards. Five test jobs failed; every failure has matching pre-existing evidence below. The tests and the relevant refusal, worker-admission, session mutation, and cache-validity owners are unchanged by this cleanup. Landing uses the maintainer-authorized inherited-failure exception, pinned to `714c365b1775c10760276a4dbc8bbf05141d4e5d`; no green-CI claim is made. - Independent autoreview is scoped-clean at P0/P1 after supplying unchanged owner context: the early ref-mode branch still enforces env-reference precedence; all migration command entrypoints retain the Codex-only flag guard; the cleanup serializer already normalizes local paths while delegated paths bypass it. Existing tests cover all three contracts. - Blacksmith admission expired before checkout ([run](https://github.com/openclaw/openclaw/actions/runs/37057668205)); validation moved to direct AWS Linux compute. Release-note context: internal cleanup only; no operator action or migration required. ### CI failure attribution | PR job | Failure | Baseline evidence | | --- | --- | --- | | `checks-node-changed-compact-small-18` | `session-reaper.test.ts`: shared exact store discovers `[main]` instead of `[main, ops]` | Same assertion on [main run 37072934260](https://github.com/openclaw/openclaw/actions/runs/37072934260/job/111056682704). | | `checks-node-changed-compact-large-1` | `session-sharing-groups.test.ts`: expected seeded host database to be defined | Same error on [main run 37072934260](https://github.com/openclaw/openclaw/actions/runs/37072934260/job/111056682541). Worker-backed seeding no longer promises an open host database. | | `checks-node-changed-compact-large-21` | `doctor-config-preflight.test.ts`: retired Discord channel `allow` fixture refused | Same test/error on [independent PR run 37071278542](https://github.com/openclaw/openclaw/actions/runs/37071278542/job/111051475776). Discord retirement predates this cleanup. | | `checks-node-changed-1` | `doctor.auth-profile-consumers.e2e.test.ts`: two maintenance-entry refusals | Same cases/error on [independent PR run 37071278542](https://github.com/openclaw/openclaw/actions/runs/37071278542/job/111051475801). The fixture starts asynchronous worker retirement through a synchronous close, then blocks the parent event loop with `spawnSync`. | | `checks-node-changed-compact-large-6` | `session-accessor.sqlite-data-version.test.ts`: identical values lose object identity after transcript append | Same test/identity assertion on [independent PR run 37071278542](https://github.com/openclaw/openclaw/actions/runs/37071278542/job/111051475748). The changed fingerprint parser is used by quarantine-receipt decoding, not this cache validity path. | The session-sharing job additionally failed `rechecks group members at transaction admission for a defaults update`: the mutation correctly rejected revoked authorization, but the broad worker-admission spy observed a commit (`true` instead of `false`). The exact test, error, and assertion at line 409 also failed on [main run 37067275144](https://github.com/openclaw/openclaw/actions/runs/37067275144/job/111038492452), before this PR. It passed in the next hourly main run, so that later pass is not presented as a repair. Its underlying race remains coordinator-owned. No tests, timeouts, assertions, or admission checks have been weakened.
What Problem This Solves
Commands, Doctor, and infrastructure repeat option forwarding, migration traversal, result projection, and error handling that already have canonical owners.
User Impact
No intended user-visible change. CLI flags, messages, exit codes, JSON output, migration precedence, persisted data, and authorization checks stay unchanged. Supported July 2026-and-later migrations and the older-Gateway node-list fallback remain supported.
Why This Change Was Made
This combines the subsystem cleanup into one batch, removing 1,459 net production lines instead of paying for separate CI runs for each small simplification.
Updater lifecycle, dependencies, schemas, and plugin SDK contracts are unchanged. The native assertion-baseline tool records five removed assertions; no allowance grows. No newly discovered product bugs or flaky-test fixes are included.
Evidence
nice -n 15confirmation completed with 82 Gateway tests passing and one 120-second timeout in the Telegram live-owner test; Doctor did not run because the first group failed. Native worker compilation took 566 seconds under severe host load. The failure is recorded, not counted as passing proof.714c365b1775c10760276a4dbc8bbf05141d4e5d; no green-CI claim is made.Release-note context: internal cleanup only; no operator action or migration required.
CI failure attribution
checks-node-changed-compact-small-18session-reaper.test.ts: shared exact store discovers[main]instead of[main, ops]checks-node-changed-compact-large-1session-sharing-groups.test.ts: expected seeded host database to be definedchecks-node-changed-compact-large-21doctor-config-preflight.test.ts: retired Discord channelallowfixture refusedchecks-node-changed-1doctor.auth-profile-consumers.e2e.test.ts: two maintenance-entry refusalsspawnSync.checks-node-changed-compact-large-6session-accessor.sqlite-data-version.test.ts: identical values lose object identity after transcript appendThe session-sharing job additionally failed
rechecks group members at transaction admission for a defaults update: the mutation correctly rejected revoked authorization, but the broad worker-admission spy observed a commit (trueinstead offalse). The exact test, error, and assertion at line 409 also failed on main run 37067275144, before this PR. It passed in the next hourly main run, so that later pass is not presented as a repair. Its underlying race remains coordinator-owned. No tests, timeouts, assertions, or admission checks have been weakened.Merged as
b0072ac3c36eaeeed2f03834f279d4df268c8e5f; ancestry verified on freshorigin/main. The five failed jobs above remain inherited CI issues for the coordinator.