Skip to content

refactor(cli): reuse command-group names - #146893

Merged
steipete merged 2 commits into
mainfrom
codex/perf-sep13-cli-group-names
Sep 13, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/perf-sep13-cli-group-names

Conversation

@steipete

@steipete steipete commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

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 registerProgramCommands facade 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.

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.
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 13, 2026 08:58
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 13, 2026, 7:28 AM ET / 11:28 UTC (Revision 2).

ClawSweeper review

What this changes

The 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
Reviewed head: 2a370b80e2a4626dcda4bc1203fc72708b907ede

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Recorded reviewer rating: A focused, compatible cleanup with the import-cycle repair verified and no remaining actionable findings. Real behavior proof remains required by host policy.
Proof confidence 🌊 off-meta tidepool Recorded reviewer rating; Required by policy: the recorded not-applicable assessment does not satisfy the current PR proof policy. Put relevant after-change evidence in the main PR body, then request a fresh review with @clawsweeper re-review. Recorded reviewer context: The verified repository-admin author is exempt from ordinary external-contributor proof for this internal builder cleanup; no authority boundary changes. Reported registration, completion, and reparse parity remains supplemental and was not independently executed here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Required by policy Required by policy: the recorded not-applicable assessment does not satisfy the current PR proof policy. Put relevant after-change evidence in the main PR body, then request a fresh review with @clawsweeper re-review. Recorded reviewer context: The verified repository-admin author is exempt from ordinary external-contributor proof for this internal builder cleanup; no authority boundary changes. Reported registration, completion, and reparse parity remains supplemental and was not independently executed here.
Evidence reviewed 9 items Introduced change: The complete host-pinned merge-base-to-head patch changes only the descriptor builder. It retains the same names used to resolve placeholders and preserves registration arguments and lazy callbacks.
Existing consumer contract: The shared group contract already accepts optional readonly names; lookup, removal, and lazy registration consume them through the existing fallback. All three builder call sites were inspected, including completion ordering and alias groups.
Current main still omits names: The fetched main builder still returns placeholders and register without names, so the proposed reuse remains distinct work.
Findings None None.
Security None None.

How this fits together

OpenClaw 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]
Loading

Before merge

  • Add real behavior proof - Required by policy: the recorded not-applicable assessment does not satisfy the current PR proof policy. Put relevant after-change evidence in the main PR body, then request a fresh review with @clawsweeper re-review. Recorded reviewer context: The verified repository-admin author is exempt from ordinary external-contributor proof for this internal builder cleanup; no authority boundary changes. Reported registration, completion, and reparse parity remains supplemental and was not independently executed here.
Agent review details

Security

None.

PR surface

Source -4. Total -4 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 3 7 -4
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 3 7 -4

Review metrics

None.

Technical review

Best 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.

Labels

Label justifications:

  • P3: This is a bounded internal allocation and ownership cleanup with no intended user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit. This is the recorded reviewer rating; real behavior proof remains required by host policy.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Required by policy: the recorded not-applicable assessment does not satisfy the current PR proof policy. Put relevant after-change evidence in the main PR body, then request a fresh review with @clawsweeper re-review. Recorded reviewer context: The verified repository-admin author is exempt from ordinary external-contributor proof for this internal builder cleanup; no authority boundary changes. Reported registration, completion, and reparse parity remains supplemental and was not independently executed here.

Evidence

What I checked:

  • Introduced change: The complete host-pinned merge-base-to-head patch changes only the descriptor builder. It retains the same names used to resolve placeholders and preserves registration arguments and lazy callbacks. (src/cli/program/command-group-descriptors.ts:29, 2a370b80e2a4)
  • Existing consumer contract: The shared group contract already accepts optional readonly names; lookup, removal, and lazy registration consume them through the existing fallback. All three builder call sites were inspected, including completion ordering and alias groups. (src/cli/program/register-command-groups.ts:29, 2a370b80e2a4)
  • Current main still omits names: The fetched main builder still returns placeholders and register without names, so the proposed reuse remains distinct work. (src/cli/program/command-group-descriptors.ts:34, bc6b662e0421)
  • Latest release comparison: The v2026.9.4 builder likewise omits names and retains the redundant return shape. (src/cli/program/command-group-descriptors.ts:21, 3a9d69db306c)
  • Re-review repair verified: GitHub's exact-head commit patch confirms removal of the register-command-groups type import and replacement with inferred return typing plus an explicitly typed callback. The previous structured review contained no code findings. (src/cli/program/command-group-descriptors.ts:2, 2a370b80e2a4)
  • Proof classification and author status: Live GitHub permission lookup verifies steipete as repository admin. The ordinary external-contributor proof gate therefore does not apply. The captured PR body reports 37 passing tests, zero Madge cycles, and earlier registration/completion/reparse parity; these are reported results, not independently executed runtime proof.

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-13T09:25:00.704Z sha d791ada :: needs real behavior proof before merge. :: none

@steipete
steipete merged commit bfe2fdf into main Sep 13, 2026
191 of 192 checks passed
@steipete
steipete deleted the codex/perf-sep13-cli-group-names branch September 13, 2026 12:50
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* 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)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* 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)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* 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)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant