Repository navigation
Conversation
|
🦞👀 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 maintainer review before merge. What this changesPlugin build and validation now display existing input-error diagnostics through the shared expected-error renderer. Example: Run openclaw plugins build --entry ./dist/index.js before compiling the plugin.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current-main diagnostic bug with a focused change; the previous allocation finding is resolved, and no new defects were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherPlugin authoring commands read package metadata and load the selected entry, then generate or validate manifests; the root CLI renders thrown failures. flowchart LR
A[Plugin author] --> B[Build or validate CLI]
B --> C[Authoring input checks]
C --> D[Expected CLI error]
D --> E[Shared failure renderer]
E --> F[Specific diagnostic]
Technical reviewBest possible solution: Use the existing expected-error contract at the authoring input checks, as this PR does. Do we have a high-confidence way to reproduce the issue? Current-main input checks throw ordinary errors that the shared renderer suppresses; the contributor also records the failing shipped CLI commands, but no target code was executed during this read-only review. Is this the best way to solve the issue? The patch is the smallest complete fix: classify known input failures at their existing producers, preserve parser causes, and reuse the shared renderer without intercepting plugin execution failures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 331c1aed9a22. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +8, Tests +26, Other +2. Total +36 across 4 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 3, 2026, 1:24 PM ET / 18:24 UTC (Revision 2). |
1c108f2 to
c2eae39
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
fix(plugins): show existing errors from plugin init, build and validate `openclaw plugins init`, `build` and `validate` threw plain errors for their existing guards (for example init into a non-empty directory, or an invalid or missing manifest), so the specific message was hidden behind a generic failure. They now use the existing expected-CLI-error path, so the existing message is shown. Messages, exit codes and the no-write behavior are unchanged; successful runs are unchanged. Sweep of #191979 and #191986; both contributor commits are kept. #191991 (pack) is related but not included, because it adds new wording. Evidence: built CLI, twice per ref. All 26 rejected commands kept exit 1 and left the project unchanged; main printed generic errors and this change prints the existing specific messages. Successful init, build and validate output is identical. Details: #192857. Thanks @yxshee. Co-authored-by: yxshee <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
fix(plugins): show existing errors from plugin init, build and validate `openclaw plugins init`, `build` and `validate` threw plain errors for their existing guards (for example init into a non-empty directory, or an invalid or missing manifest), so the specific message was hidden behind a generic failure. They now use the existing expected-CLI-error path, so the existing message is shown. Messages, exit codes and the no-write behavior are unchanged; successful runs are unchanged. Sweep of openclaw#191979 and openclaw#191986; both contributor commits are kept. openclaw#191991 (pack) is related but not included, because it adds new wording. Evidence: built CLI, twice per ref. All 26 rejected commands kept exit 1 and left the project unchanged; main printed generic errors and this change prints the existing specific messages. Successful init, build and validate output is identical. Details: openclaw#192857. Thanks @yxshee. Co-authored-by: yxshee <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes: running
openclaw plugins build --entry ./dist/index.jsoropenclaw plugins validate --entry ./dist/index.jsbefore compiling the plugin (theplugin:buildscript fromopenclaw plugins initdoes exactly this aftertsc) prints only "The CLI command failed. For help, runopenclaw doctor." The author can't tell that the entry file is simply missing. The same generic line hides "package.json not found", "Malformed JSON in package.json", an entry outside the plugin root, and an entry without authoring metadata.User Impact
User impact: these commands now print the reason, for example
plugin entry not found: ./dist/index.js. Exit codes andplugins validate --jsonoutput are unchanged.Why This Change Was Made
The authoring input checks threw plain
Error, which the root failure renderer treats as unexpected and replaces with the generic line. They now use the existingthrowExpectedCliErrorhelper (andExpectedCliErrorwith the parse error ascausefor malformed JSON). Messages are unchanged. Errors thrown by the plugin's own code while loading still go through the unexpected-error path.Evidence
Built from
mainat b018452 on Linux, Node 24.22.2, fresh state directory, in a project created byopenclaw plugins init demo(path shortened to<demo>).Before:
After:
All exit 1, as before.
Tests:
pnpm test src/cli/plugins-authoring-command.test.ts --maxWorkers=1: 32 passed.plugins-authoring-command.utf8,plugins-authoring-validationandplugins-authoring.processtests also pass.New cases "names the missing entry when build/validate runs before the entry is compiled" check for
ExpectedCliErrorand theformatCliFailureLinesoutput. Both fail onmainand pass with the fix.oxfmt --checkandoxlint --type-awareon the changed files: clean.Test-line budget: the regression tests add 26 net lines, recorded in
config/test-lines-allocations/plugins-build-missing-entry.txt. Rebased on currentmain.