Repository navigation
refactor(cli): reuse command-group names - #146893
Conversation
Keep the private names already known by the descriptor builder and use the canonical command-group entry type. Preserve the public optional-name fallback and existing registration, completion, update and plugin-loading behavior.
|
🦞👀 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 real behavior proof before merge. Reviewed September 13, 2026, 7:28 AM ET / 11:28 UTC (Revision 2). ClawSweeper reviewWhat this changesThe CLI command-group builder retains existing command names for registration and completion lookups while removing a redundant return-type definition. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this focused cleanup remains absent from current main and the latest release. No actionable correctness or security defect was found, and the reported import-cycle problem is repaired. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw builds lightweight command placeholders from descriptors, then loads their command groups when invoked or when generating shell completion. Shared group names identify which placeholders to replace. flowchart LR
A[Command descriptors] --> C[Command group builder]
B[Names and lazy registrars] --> C
C --> D[Groups retaining names]
D --> E[Command lookup and replacement]
E --> F[Invoked CLI command]
E --> G[Shell completion]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -4. Total -4 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Retain names at the existing builder and consume the established optional-name contract without adding imports, changing command order, or altering public fallback behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving cleanup, not a reported functional failure; source inspection confirms the repeated fallback allocation. Is this the best way to solve the issue? Yes: retaining the builder's existing names uses the established consumer contract and removes redundant typing without introducing another owner or import edge. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bc6b662e0421. 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)
|
|
Merged via squash.
|
* temp/pr-145950: (101 commits) refactor(memory-wiki): share freshness result construction (#146935) improve(gateway): use metadata projection for presence (#146817) test(agents): reuse complete Responses model fixtures (#147015) fix(sessions): align the reclamation-memory test with the archive session owner (#147028) refactor(terminal): simplify copy-sensitive token checks (#146934) refactor(media): remove duplicate spaced path fallback (#146933) refactor(cli): reuse command-group names (#146893) improve(plugins): reduce JavaScript generation capture work (#146993) test: align plugin fixtures with current runtime contracts (#147000) refactor(browser): separate session tab tracking from cleanup (#146973) fix(tests): make systemd clock fixtures private (#146990) fix(linux): retire sleep guards when logind disconnects (#146046) refactor(matrix): share draft fallback delivery (#144840) fix(sessions): preserve cross-agent replies after reload (#146799) test(models): cover quota recovery during catalog discovery (#146708) fix(macos): recover browser sign-in when no browser opens (#146787) fix(process): prevent one-shot agents exiting while polling (#144268) fix(status): label the session inventory as stored (#146979) fix: avoid repeated background reads while loading chat (#146953) refactor(ui): narrow Skill Workshop proposal context (#146977) ...
* commit '060e856e5f9df245d63c98990fcb47e18108c6b9': (97 commits) refactor(memory-wiki): share freshness result construction (#146935) improve(gateway): use metadata projection for presence (#146817) test(agents): reuse complete Responses model fixtures (#147015) fix(sessions): align the reclamation-memory test with the archive session owner (#147028) refactor(terminal): simplify copy-sensitive token checks (#146934) refactor(media): remove duplicate spaced path fallback (#146933) refactor(cli): reuse command-group names (#146893) improve(plugins): reduce JavaScript generation capture work (#146993) test: align plugin fixtures with current runtime contracts (#147000) refactor(browser): separate session tab tracking from cleanup (#146973) fix(tests): make systemd clock fixtures private (#146990) fix(linux): retire sleep guards when logind disconnects (#146046) refactor(matrix): share draft fallback delivery (#144840) fix(sessions): preserve cross-agent replies after reload (#146799) test(models): cover quota recovery during catalog discovery (#146708) fix(macos): recover browser sign-in when no browser opens (#146787) fix(process): prevent one-shot agents exiting while polling (#144268) fix(status): label the session inventory as stored (#146979) fix: avoid repeated background reads while loading chat (#146953) refactor(ui): narrow Skill Workshop proposal context (#146977) ...
* temp/pr-137049: (110 commits) improve: reduce GitHub OAuth maintenance work for large agent rosters (#147021) fix(test): avoid settings lock writer startup timeouts (#147029) fix(update): correct backup guidance and cover incident regressions (#147023) refactor(gateway): share connection lifecycle across transports (#145950) refactor(telegram): share HTML text escaping (#146936) perf(build): reduce disk use in UI performance checks (#146687) refactor(memory-wiki): share freshness result construction (#146935) improve(gateway): use metadata projection for presence (#146817) test(agents): reuse complete Responses model fixtures (#147015) fix(sessions): align the reclamation-memory test with the archive session owner (#147028) refactor(terminal): simplify copy-sensitive token checks (#146934) refactor(media): remove duplicate spaced path fallback (#146933) refactor(cli): reuse command-group names (#146893) improve(plugins): reduce JavaScript generation capture work (#146993) test: align plugin fixtures with current runtime contracts (#147000) refactor(browser): separate session tab tracking from cleanup (#146973) fix(tests): make systemd clock fixtures private (#146990) fix(linux): retire sleep guards when logind disconnects (#146046) refactor(matrix): share draft fallback delivery (#144840) fix(sessions): preserve cross-agent replies after reload (#146799) ...
* refactor(cli): reuse command-group names Keep the private names already known by the descriptor builder and use the canonical command-group entry type. Preserve the public optional-name fallback and existing registration, completion, update and plugin-loading behavior. * fix(cli): avoid descriptor type import cycle
What Problem This Solves
CLI command-group construction discards names it already owns, causing registration and completion lookups to reconstruct them from placeholders.
User Impact
No user-visible behavior change is intended. Command names, aliases, registration order and completion behavior remain unchanged; no migration or operator action is required.
Why This Change Was Made
Keep existing names on internally built groups and remove the duplicate return-type shape. The builder infers its result with an explicitly typed callback; callers enforce the canonical command-group contract. This removes four production lines and redundant name-array allocation while preserving the public optional-name fallback, lazy callbacks, update behavior and plugin-loading policy.
Evidence
Repair CI run 34754248689 passed at
2a370b80e2a4626dcda4bc1203fc72708b907ede: 114 successful jobs, 17 skipped, including the required CI gate, architecture, core production types, all 18 canonical core-test graphs through the five-stripe union and tail, and all five core type-aware lint stripes. This is not a claim that the literal full lint command ran.The repaired source also passed Madge with zero cycles and all 37 tests in the same three existing registry, sub-CLI and plugin-group files, with no skips. Formatting and diff checks passed. Fresh Codex P2 review found only the old cyclic index version; staging the exact reviewed working-tree repair resolved it, with no additional working-tree findings.
The original CI run caught a genuine static cycle introduced by the type import even though the runtime-only cycle guard passed. The repair removes that back-edge without a new module or suppression. Both earlier local 6 GiB type/lint resource failures remain recorded; their limits were not raised and the checks were not retried locally. The separate Labeler HTTP 422 permission failure was auxiliary, not required.
Earlier functional proof exercised the real
registerProgramCommandsfacade with plain Commander, completion-group visits and lazy replacement/reparse with omitted and explicit names: all 12 paired observations matched. The original author also passed 26 selected small guards. These retain their original source labels; the repair only changes erased type imports/annotations and preserves the runtime implementation. This is boundary proof, not full CLI startup, generated shell-script proof or a measured speedup.ClawSweeper's completed exact-head review verified the repair and admin exemption and reported no code/security finding. Maintainer assessment treats its contradictory generic external-contributor proof checkbox as inapplicable to this internal cleanup, given the actual proof above. The reviewer did not execute these tests; its comment and markers remain unchanged. All enforced review and required-check gates still apply.