Repository navigation
Plugins/CLI: add descriptor-backed lazy root command registration - #57165
Conversation
Greptile SummaryThis PR is a targeted fix that restores synchronous Matrix CLI registration, which was inadvertently broken by a March 28 refactor that made the Key changes:
The fix is minimal, well-scoped, and directly addresses the stated root cause. The regression test is well-structured and would have caught the original bug. Confidence Score: 5/5Safe to merge — the change is minimal, targeted, and correct, with a solid regression test. No P0 or P1 issues found. The fix precisely reverts the async→sync regression, the static import is correct, the crypto bootstrap remains lazy-loaded, and the new test directly covers the failure mode. No files require special attention.
|
| Filename | Overview |
|---|---|
| extensions/matrix/index.ts | Moved registerMatrixCli to a static import and made the registerCli callback synchronous. Crypto bootstrap remains lazy via void import(...). Fix is correct and minimal. |
| extensions/matrix/index.test.ts | New regression test correctly verifies synchronous CLI registration: checks registerCli is called with a plain function and that invoking the registrar returns undefined (not a Promise). |
Reviews (1): Last reviewed commit: "Matrix: restore synchronous CLI registra..." | Re-trigger Greptile
There was a problem hiding this comment.
Pull request overview
Restores synchronous registration of the Matrix CLI so the matrix command is available at CLI parse time, while keeping heavier initialization lazy where possible.
Changes:
- Register Matrix CLI synchronously by using a static import and non-
asyncregistrar callback - Add a Vitest regression test ensuring the registrar is synchronous and invoked correctly
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| extensions/matrix/index.ts | Switches Matrix CLI registration back to a synchronous registrar callback. |
| extensions/matrix/index.test.ts | Adds a regression test verifying synchronous CLI registration behavior. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85e8bea059
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
85e8bea to
473ef56
Compare
473ef56 to
105167b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 105167b25b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50b43cf057
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e91405576d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e914055 to
50b43cf
Compare
50b43cf to
9251a4b
Compare
9251a4b to
ad1dee3
Compare
|
Merged via squash.
Thanks @gumadeiras! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad1dee32eb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…enclaw#57165) Merged via squash. Prepared head SHA: ad1dee3 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…enclaw#57165) Merged via squash. Prepared head SHA: ad1dee3 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…enclaw#57165) Merged via squash. Prepared head SHA: ad1dee3 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…enclaw#57165) Merged via squash. Prepared head SHA: ad1dee3 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…enclaw#57165) Merged via squash. Prepared head SHA: ad1dee3 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…enclaw#57165) Merged via squash. Prepared head SHA: ad1dee3 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…enclaw#57165) Merged via squash. Prepared head SHA: ad1dee3 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…enclaw#57165) Merged via squash. Prepared head SHA: ad1dee3 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…enclaw#57165) Merged via squash. Prepared head SHA: ad1dee3 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…enclaw#57165) Merged via squash. Prepared head SHA: ad1dee3 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…enclaw#57165) Merged via squash. Prepared head SHA: ad1dee3 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Summary
openclaw <plugin> --helpand dispatch see the real command treeRoot cause
A March 28 refactor changed the Matrix plugin CLI registrar to async, but plugin CLI registration during root CLI startup still assumed registration happened synchronously enough for parse-time command discovery. That let the Matrix plugin load while leaving the
matrixcommand missing from the root command tree.Implementation
src/plugins/cli.tsto lazily install descriptor-backed plugin commands at the root CLI level while eagerly loading the selected plugin primaryregisterCli(..., { descriptors })contract in the plugin SDK docs and examplesVerification
pnpm checkpnpm buildpnpm test, but local Vitest still hangs immediately after the startup banners on this machine, so full test confirmation should come from CI