Repository navigation
refactor(cli): deduplicate lazy subcommand registration - #129351
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 11:57 PM ET / August 26, 2026, 03:57 UTC. ClawSweeper reviewWhat this changesThe PR replaces repeated lazy CLI subcommand descriptor objects with typed tuples mapped through the existing lazy-loader helper. Merge readinessKeep open. Current main still has the repeated object descriptors, while this one-file refactor preserves the existing lazy-registration path with no source-visible correctness defect; it is maintainer-owned and awaits exact-head CI completion. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherThe CLI program builder receives process arguments and registers root-command placeholders. A lazy subcommand group replaces the selected placeholder by dynamically importing its command module when that command is invoked. flowchart LR
A[CLI arguments] --> B[Program builder]
B --> C[Subcommand registry]
C --> D[Lazy command group]
D --> E[Dynamic module import]
E --> F[Registered command]
Decision needed
Why: The PR carries the protected maintainer label and is authored by a repository member, so it should not be auto-closed or auto-merged by this workflow. Before merge
Agent review detailsSecurityNone. PR surfaceSource -122. Total -122 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the local adapter and tuple declarations, then merge after exact-head validation confirms the unchanged lazy CLI behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is a behavior-preserving refactor, and the relevant question is equivalence of existing CLI registration behavior rather than reproduction of a defect. Is this the best way to solve the issue? Yes. Keeping the tuple-to-object conversion local avoids changing the generic command-group API while retaining its existing runtime validation and lazy-loading behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 937c89675b04. LabelsLabel 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 |
71820b9 to
5668eda
Compare
|
Merged via squash.
|
* origin/main: (24 commits) fix(gateway): reject rootless session permission modes (#128149) docs(memory): document shipped turn-taint propagation for network tool output (#129837) fix(ui): pool reply-less wake activity into one chat rollup (#128442) fix(package): prevent installs from deleting validated runtime assets (#129724) fix(nodes): approve silent initial node surfaces and name the pending surface approval (#129795) fix(backup): preserve configured agent state roots (#129773) fix(ui): own chat history issuance with a closed state machine (#129776) fix(cron): preserve cancellation reason after late finalization (#129331) fix(cron): prevent run waits from failing after clock changes (#129805) fix(telegram): route commentary through one frozen progress owner (#128259) fix(release): start approved VCR mirror recovery jobs (#129829) test: complete current-plugin-metadata-snapshot mock factories (#129791) test(telegram): remove duplicate reaction case (#129848) fix(channels): honor supported account reply-threading policies (#129679) refactor(cli): deduplicate lazy subcommand registration (#129351) fix(ai): report interrupted local-model streams instead of empty success (#129794) refactor(cli): consolidate Gateway fallback and hook ownership (#129802) fix(qa): reject token confidence lanes without executed evidence (#129830) fix(tui): fence session state and delayed actions (#129810) fix(control-ui): keep task progress full width on hover (#129832) ...
What Problem This Solves
The main CLI lazily registers dozens of subcommands through repetitive, nearly identical descriptor declarations, making command ordering, aliases, and startup behavior harder to audit and maintain.
Why This Change Was Made
Factor the existing private registration descriptors through typed local tuples and the existing canonical lazy-loader helper. Preserve all 35 descriptors, four command groups, five custom registrars, every dynamic import and public command alias, and the existing declaration surface while deleting 122 net lines from shipped CLI production code.
User Impact
No CLI behavior changes: root help, subcommand help, aliases, completion, private-command gating, command ordering, and lazy module loading remain unchanged.
Evidence