Repository navigation
refactor(cli): simplify message command action registration - #129122
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 4:06 AM ET / 08:06 UTC. ClawSweeper reviewWhat this changesThe PR returns the shared message-action Promise directly from message-command callbacks and removes the unused pin-command array. Merge readinessNo concrete regression was found in this behavior-neutral cleanup, but the exact Commander 15 action-awaiting contract remains unverified locally; keep this maintainer PR open through exact-head validation. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe CLI registers flowchart LR
A[CLI arguments] --> B[Message command tree]
B --> C[Commander action callback]
C --> D[Shared message action runner]
D --> E[Plugin and channel operation]
E --> F[CLI exit result]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -64. Total -64 across 10 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Validate the exact Commander 15 action-chain contract and the message command smoke path on the PR head, then retain this smaller direct-delegation shape. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-neutral refactor, and the relevant question is whether Commander preserves returned-Promise action semantics. The source path is clear, but this read-only node_modules-less checkout could not run or inspect the pinned dependency. Is this the best way to solve the issue? Unclear: direct delegation is the simplest canonical shape because the shared helper already returns a Promise, but exact Commander 15 contract proof is still needed before calling it the best validated solution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 203024eb33ee. LabelsLabel changes:
Label 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
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
What Problem This Solves
Maintainer-requested cleanup: message command registration repeated the same redundant async wrapper for nearly every subcommand, while pin registration built and discarded an unused array. The extra ceremony made the command family noisier without owning any distinct behavior.
Why This Change Was Made
Return the existing canonical message-action Promise directly from 31 Commander action callbacks and register the three pin commands directly. Preserve the meaningful thread-create normalization boundary, every command option/action mapping, execution order, and failure behavior. Production code decreases by 64 lines without adding an abstraction.
User Impact
No user-visible behavior change. Message commands, options, asynchronous completion, errors, and post-action hooks retain their existing behavior.
Evidence
node scripts/run-vitest.mjs src/cli/program/message/helpers.test.ts src/cli/program/message/register.thread.test.ts src/cli/program/register.message.test.ts src/cli/program/command-tree.test.ts src/cli/program/root-command-descriptions.test.ts src/commands/message.test.ts— six files, 74 passing tests.OPENCLAW_CHECK_CHANGED_SKIP_DEADCODE=1 node scripts/check-changed.mjs -- src/cli/program/message/register.broadcast.ts src/cli/program/message/register.discord-admin.ts src/cli/program/message/register.emoji-sticker.ts src/cli/program/message/register.permissions-search.ts src/cli/program/message/register.pins.ts src/cli/program/message/register.poll.ts src/cli/program/message/register.reactions.ts src/cli/program/message/register.read-edit-delete.ts src/cli/program/message/register.send.ts src/cli/program/message/register.thread.ts. The identical unchanged patch had already passed the production, full-tree, and script dead-export scans separately.parseAsyncawaits the action chain.AI-assisted maintainer-requested refactor.