Repository navigation
refactor: consolidate Doctor and update CLI workflows - #166633
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 October 7, 2026, 12:20 PM ET / 16:20 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch consolidates Doctor’s configuration and plugin repairs and simplifies update execution, recovery, and reporting while preserving existing CLI behavior. Merge readiness⛔ Blocked before merge - 5 items remain Keep open: the consolidation remains useful and no concrete introduced bug was found, but the previously requested published-updater compatibility evidence is still missing. Priority: P3 Review scores
Verification
How this fits togetherDoctor repairs configuration and installed state; the updater invokes those repairs while replacing OpenClaw and managing Gateway shutdown, recovery, and restart. These workflows consume existing operator state and produce validated configuration, installation records, and update results. flowchart TD
A[Existing installation and operator state] --> B[Update admission]
B --> C[Package or source update]
C --> D[Doctor and plugin repairs]
D --> E[Validate updated state]
E --> F[Gateway restart and update report]
E --> G[Recovery and rollback]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the consolidation with unchanged operator settings, migration outputs, and recovery behavior, backed by published-updater compatibility evidence. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes internal consolidation rather than fixing a reproduced product bug; no introduced failure was established. Is this the best way to solve the issue? Yes in direction: sharing private repair and execution mechanics follows existing ownership boundaries, but upgrade compatibility still needs the required production-boundary evidence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 947b35844d17. LabelsLabel changes: No label changes. Label 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 |
Share Doctor tool-policy preparation, TTS rule locations, plugin repair candidate selection, and default/agent model repair mechanics. Reuse update executor admission/retirement bookkeeping and lineage tuple serialization. Keep messages, config shapes, CLI behavior, and shipped migrations intact. Remove 240 net production lines across eight files; no tests changed. Validation: independent P0-P2 review clean; production and test-graph typechecks; corrected scoped lint; zero runtime and Madge cycles; 162 original/current lineage hash comparisons; lint-suppression tests. Plugin dependency-repair integration passes all four cases with inherited ZAI provider credentials excluded from its synthetic fixture environment. One focused executor child deadline failure reproduced on the original base. A broader legacy-finalization run had seven child deadline failures: four reproduced on the base, three did not reproduce. Full directory proof remains incomplete; no timeout, retry, assertion, or skip was changed. Below the campaign's 500-line PR floor: branch handoff only.
a3abdf9 to
8a9c9ff
Compare
What Problem This Solves
Doctor and update workflows repeat migration, repair, execution-context, and reporting mechanics across related paths.
User Impact
No intended user-visible behavior changes relative to main. Migration inputs, CLI flags and diagnostics, authority checks, recovery ordering, and persisted shapes remain intact, including July 2026+ inputs.
Why This Change Was Made
Consolidate private Codex compaction repair into its configuration-repair owner; share migration walkers, plugin repair mechanics, and result construction; bind updater context once; and remove single-use forwarding modules and unreachable selected-install states. Real variant policies remain explicit. Tests for the removed stdio helper now assert the actual child spawn and stream-routing boundary.
The audit covers 291 production files; protected PR-tooling closure files remain unchanged. The branch removes 1,512 net production lines, excluding tests, fixtures, generated/declaration files, and the shrink-only assertion baseline—approximately 2.3% of the subsystem, below the campaign's 3% target.
The latest conflict-only rebase preserves main's deferred plugin activation warning, excludes unresolved state work from completion records, and retains main's ClawHub/source identity checks. All seven upstream edits in the two auto-merged plugin modules were verified byte-for-byte.
Evidence
Candidate head:
8a9c9ff705f4ce9263cc1bf8bef2c3659732aa14; source tree:e32567279f102d656dfd534e0b1e50a2904ba8e9; base:02e2078de7f634af018906abd7a43c3e275d5e25.0d06bc0fec0129608ed04ed286e7e1e2c28021e3: parent-git-root-switch, parent-revoked, and parent-retargeted each passed 5/5 on base and 5/5 on current head. Zero failures or invalid runs; minimum pre-run CPU idle was 87.99%.37661363774succeeded on the exact head. The completed check-run census contained 88 successes, 49 skips, one neutral, zero failures, and zero cancellations; all three status contexts succeeded.Earlier local failures of the three named finalizer cases were not reproduced in the controlled comparisons. Their cause remains unconfirmed; passing replays are not presented as a flake fix.
The two changed test files passed one-worker cost measurement without changing timeouts, retries, or skips:
update-command-post-core-root.test.tsupdate-command.test.tsHosted times sum reported case durations and exclude shared shard setup. The opt-in live Node-runtime suite was not run.
CI fixture repair and current status
The previous head's Bun shard failed unchanged Homebrew teardown with an active native database borrower. Both cancelled jobs were replayed successfully. Standalone Node and matching Bun-selection comparisons passed on both main and that head, without establishing an inherited-failure waiver.
The coordinator-approved fixture repair landed separately on main as
02e2078de7f634af018906abd7a43c3e275d5e25: installation-layout and migrated-update teardown now await the existing shared database cleanup owner. Every assertion, timeout, retry, and skip is unchanged. Its proof passed 39 Linux tests, 8 Bun tests, changed checks, zero runtime/Madge cycles, and independent review. These fixture changes are in the base, not this PR diff.Current-head hosted CI is green. No inherited-failure or admin exception is needed.