Repository navigation
refactor(cli): simplify lazy command registration - #139108
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: needs maintainer review before merge. Reviewed September 5, 2026, 1:45 PM ET / 17:45 UTC. ClawSweeper reviewWhat this changesSimplifies deferred CLI command registration and consistently hides the retired setup alias from help while keeping it callable. Merge readiness✅ Ready for maintainer review Useful work remains absent from main and v2026.9.1. No blocking introduced defects were found, and direct inspection of Commander 15.0.0 resolves the previous review’s dependency limitation. Priority: P3 Review scores
Verification
How this fits togetherThe CLI registration layer turns command descriptors and invocation arguments into help entries and executable commands. It loads command implementations on demand and supplies the command tree used for shell completion. flowchart TD
A[CLI arguments] --> C[Command registration]
B[Command descriptors] --> C
C --> D[Lightweight placeholders]
D --> E[Help with visibility rules]
D --> F[Load selected command group]
F --> G[Parse and run command]
F --> H[Shell completion tree]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -231, Tests -82. Total -313 across 16 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep typed lazy callbacks and propagate descriptor visibility through the shared placeholder owner, preserving existing alias and completion behavior. Do we have a high-confidence way to reproduce the issue? Yes, from source: uncached root help uses lazy placeholders that discard hidden metadata on main, unlike direct registration. This read-only review did not execute a runtime reproduction. Is this the best way to solve the issue? Yes. Forwarding existing metadata at the shared registration boundary fixes the inconsistency without alias-specific filtering, while typed callbacks remove redundant adapters. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 402f514805ce. LabelsLabel 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)
|
cac48b0 to
b12b49c
Compare
|
The failed typecheck/tooling jobs came from the prebuilt UI harness importing the removed readiness helper. Main already fixed that in #139123. This branch is now rebased onto that fix; all 15 recorded candidate file hashes and the test deletion match the reviewed/live-tested version. The renewed 447-test run, 80 real CLI comparisons and independent P2 review passed. The 13 prebuilt-harness tests also pass on the integrated branch. Fresh CI is running; no helper compatibility shim or assertion/timeout change was added. |
|
Native prepare passed for |
|
Merged via squash.
|
* commit '911d7d5b0c107f7274f2415ca9655dcc6105f0e8': (867 commits) fix(skills): deliver pending Workshop approval controls (#139248) fix(gateway): deliver loopback ask_user prompts to the originating channel (#138831) docs: keep root agent instructions focused on repository policy (#139258) fix(matrix): exclude archived state roots from scans and selection (#112329) perf(agents): prepare exact tool names once per catalog batch (#139267) fix: preserve Swarm progress and simplify owner plumbing (#139269) fix(tailscale): release claims after gateway process-group exit (#139261) refactor(cli): simplify lazy command registration (#139108) test(ui): retain synthetic widget failure evidence (#139229) fix(buzz): keep implicit replies at thread root (#138879) test(diagnostics): await graceful Gateway shutdown before cleanup (#139247) fix(ci): unblock releases with different tooling package managers (#139259) feat(ui): add social preview links for private sessions (#139250) fix(codex): retain failed conversations for guarded continuation (#139246) chore(ui): refresh control ui locales (#139200) fix(ci): run browser checks for real-gateway inputs (#139256) fix(llama-cpp): reconcile managed router state before requests (#136363) chore(i18n): refresh native locales (#139237) refactor(worker): unify inference payload handling (#139245) refactor(terminal): replay wrapped prefixes in one pass (#139240) ...
Additional instructions
Repository maintainers have normal access to this same-repository branch.
What Problem This Solves
Fixes an issue where uncached root help shows the retired
crestodiancommand even though cached help and the registered command hide it. This also implements the maintainer-requested simplification of builtin CLI registration.Why This Change Was Made
Builtin command groups now use typed lazy registrar callbacks directly. This removes the string-based export lookup, descriptor-catalog wrappers, intermediate mapping passes, and unused core argument plumbing: 231 fewer production lines. Cheap descriptor-only help, grouped aliases, the completion import boundary, plugin registration order, and completion-specific channel options retain their existing owners.
The shared lazy placeholder now carries existing
hiddenmetadata into Commander. The public placeholder type gains only an optional field, and the dynamically loaded private QA registrar retains its boundary validation.User Impact
Existing command names, aliases, options, parsing, and shell completions are preserved. The retired alias stays callable but is consistently omitted from root help. No configuration, environment-variable, default, or persistence surfaces change.
Evidence
pnpm buildpasses, including CLI bootstrap import and plugin SDK export checks.node openclaw.mjswith an isolated synthetic home/config. The private QA artifact is absent from the normal build, so its availability error is checked instead of claiming a private-QA execution proof.