Repository navigation
refactor(cli): fold single-consumer command helpers - #176903
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR folds private CLI helpers into their existing command owners and migrates tests to those command boundaries. Example: Run openclaw message read --channel discord --target channel:123 --limit 20.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR is a useful, maintainer-directed consolidation; no actionable correctness or security defects were found, and exact-head CI passed. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCLI registration accepts parsed command options, invokes Gateway lifecycle, messaging, or skills-library operations, and produces command output and exit status. flowchart TD
A[CLI arguments] --> B[Command registration]
B --> C[Gateway lifecycle]
B --> D[Message dispatch]
B --> E[Skills library RPC]
C --> F[Output and exit status]
D --> F
E --> F
Technical reviewBest possible solution: Keep the consolidated implementations with their existing command owners while preserving the migrated behavioral contracts. Do we have a high-confidence way to reproduce the issue? No runtime defect is claimed; source comparison verifies the consolidation, and no target code was executed during this read-only review. Is this the best way to solve the issue? The change uses existing owners, deletes the superseded modules, and retains distinct command, readiness, cleanup, and file-admission coverage without adding production machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2fc8899e8b52. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -89, Tests +130, Other -6. Total +35 across 28 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 19, 2026, 12:48 AM ET / 04:48 UTC. |
|
Merged via squash.
|
What Problem This Solves
CLI registration, daemon lifecycle and skills-library commands forward their own inputs through private modules with one production consumer. Direct helper tests keep those implementation surfaces exported.
User Impact
No user-visible change; flags, output, plugin lifecycle, authorization and file admission remain unchanged.
Why This Change Was Made
Keep gateway lock replacement in external restart health, start-readiness verification in the lifecycle command, message helpers/thread registration in the message registration owner, and skills-library input/upload preparation in the library CLI. Remove the retired modules and move their retained tests through the registered production commands. Matrix and Teams integration cases invoke real Commander handlers and the real message command with their existing HTTP fixtures.
This is a CLI-area slice of the wide single-consumer family under campaign rule 11. Public flags, output, contracts and lazy imports are unchanged. Phase E is untouched.
Related: #176771, #176810 (earlier area slices of the same wide family).
Best-effort tradeoffs accepted
Net LOC
89 net production lines removed across 9 production paths; 28 total paths, including test/support and shrink-only inventory entries, which are excluded from production LOC. This final measured count supersedes the earlier draft estimate of 91. The moved action-kind cast is replaced by selecting the exact action from the existing typed list; its orphan allowance is deleted rather than moved or expanded.
Evidence
Complete source/test migration inspection and smallest-complete-cut pass completed. Formatting and whitespace checks passed. Frozen/prefer-offline dependency setup completed in 14 seconds without a tracked generated-file, manifest or lockfile change. Fresh independent P0–P2 review of the final candidate completed scoped-clean, including final source verification.
Fourteen owner/consumer files produced 256 unique passing cases, two existing completion-shell skips and two thread-suite failures caused by cold lazy imports spending compilation inside case deadlines. The same four fixture consumers passed after moving the same already-mocked I/O imports to collection: 45 cases passed, including all six thread cases; two existing shell skips unchanged. This is 258 unique passing cases across those runs, not their summed replay count. Original serial wall time was 1,205.75 seconds; the focused four-consumer replay took 1,049.28 seconds including a cold worker-cache preparation.
The selected 8 MiB piped-output subprocess exposed an orphan worker-compiler boundary still keyed to the deleted helper path (137.79 seconds, failed JSON parse). Both exact matcher references now name the registration owner, preserving the same command-module substitution. Its unchanged replay passed: complete piped JSON and exit 1, 25.151 seconds test time / 390.79 seconds Vitest wall time including cold worker preparation; wrapper completed successfully in 456.95 seconds. The other 25 cases were excluded by the explicit test-name selection, not new skips.
Final owner replay passed all 67 message/readiness cases, plus all 14 suppression cases: 341.12 seconds serial wrapper wall time, including 216.65 seconds for the owner shard and 59.57 seconds for tooling. Targeted native types across fourteen owner/consumer test roots and normal type-aware lint across nineteen core/test/support targets plus two tooling targets passed without diagnostics. Both required cycle checks passed with zero cycles. Changed-check planning completed in dry-run mode; broad gates are delegated to exact-head CI. No timeout, assertion, bound, mock breadth or expected result changed for the compiler repair.
The two root integration consumers additionally passed normal type-aware lint with their matching root-test configuration, with no diagnostics.
Exact-head CI run 39198781357 passed. Its 97 check-run rows contain 70 successes and 27 planner skips, totaling 9,786 summed check-run seconds (parallel durations, not an A/B cost estimate). No local broad suite, build, E2E, whole-graph typecheck, operator-state access, timeout increase, retry, new test skip, suppression or expanded allowance is claimed.