Repository navigation
fix(plugins): JSON5 manifests fail Control UI builds - #198808
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 changesThis PR reuses the JSON5-capable manifest reader in the CLI browser builder and repository browser-build helper. Example: A plugin declares browser.ts as its Control UI entry and includes comments in openclaw.plugin.json.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a current browser-build bug with a small, proven change and no actionable findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherPlugin authoring commands pass browser source and authored manifest metadata to the shared builder, which produces or checks immutable browser assets and their declaration. flowchart LR
A[Plugin authoring commands] --> C[Shared browser builder]
B[Repository build helper] --> C
C --> D[Existing JSON5 manifest reader]
C --> E[Browser bundler]
E --> F[Immutable assets and declaration]
Technical reviewBest possible solution: Use the existing JSON5 reader at both browser-build entry points while preserving strict generated JSON, missing-manifest handling, and source-free copying. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the strict-parser failure, and supplied paired CLI results reproduce it with commented JSON5 and a browser entry; this review executed no target code. Is this the best way to solve the issue? This is the smallest complete fix for the stated browser-authoring failure: it replaces the remaining parser mismatch, reuses existing ownership, and preserves the separate copy contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 18892937f802. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +1, Tests 0, Other 0. Total +1 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label 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 HistoryReviewed November 14, 2026, 7:03 AM ET / 12:03 UTC (Revision 3). |
|
@clawsweeper re-review |
|
Verified the user-facing authoring commands on base The shipped Source-tier proof used isolated synthetic plugins, config and state: base through host
Each failing base browser command printed Before each build, generated browser assets were removed. Both candidate builds recreated Vitest-source: the compact regression fails on base (4 failed / 27 passed, strict script parser), and all 31 tests pass in the candidate container. Changed-file formatting and lint pass there. Full build including declarations also passes in that container. The existing four browser metadata cases now use JSON5 comments rather than adding a fifth overlapping case: test delta +1/-1 (net 0); production +11/-10. Original contributor commit and credit are retained. No error/message strings were added or edited. Safety note: an initial baseline-path capture error accidentally ran candidate source/tests and install lifecycle on the host; those results were discarded, no matching processes remained, and both sides were rerun in the required locations. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
fix(plugins): accept JSON5 manifests when building plugin Control UI assets A plugin whose manifest uses JSON5 (comments or trailing commas) and declares a Control UI browser entry failed `openclaw plugins build`, `plugins build --check` and `plugins validate`, because the browser-asset builder read the manifest with strict JSON.parse while the rest of the authoring path already accepts JSON5 (openclaw#190192). It now uses the existing authoring JSON reader. The repository helper script gets the same fix, loading the reader only in its build branch so `--copy` stays source-free. No new text. Evidence: isolated synthetic plugins; base via ocx src, candidate in a secretless node:24.22.1 container; twice each. JSON5 manifest with a browser entry: base failed build/check/validate (6 of 6 exit 1), candidate passed all six; builds recreated the browser assets and check/validate left the manifest bytes unchanged. Strict JSON, JSON5 without a browser entry and a truly invalid manifest behave the same on both, with the existing errors. The regression fails on base and passes here; the existing script tests, including source-free copy, pass; full build and packed smoke pass. Net 0 test lines. Details: openclaw#198808 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]>
|
Thanks @obviyus for testing the authoring commands, invalid-manifest controls, and repeated builds, and for landing this! |
Related: #190192
What Problem This Solves
Valid JSON5 manifests fail
plugins build,plugins build --checkandplugins validatewhen the plugin declares a Control UI browser entry. The shared browser builder rereads them with strictJSON.parse.User Impact
Plugin authors can build and validate documented JSON5 manifests with browser assets; read-only checks preserve authored bytes.
Why This Change Was Made
Reuse the existing JSON5-capable authoring reader in the CLI browser builder and the separate repository browser-build helper. The shipped CLI does not invoke that repository script; its own builder change carries the fix. Keep missing-manifest handling, strict package/generated JSON, and existing message strings.
Alix-007's original commit is retained. The regression reuses the four existing browser-metadata cases with JSON5 comments instead of adding an overlapping fifth case. Production +11/-10; tests +1/-1 (net 0), no allocation file. The reader loads only in the build branch so
--copyremains source-free.Evidence
Paired command results, controls, manifest/asset hashes and isolation note.
08ae8c62b83e: JSON5/browser build/check/validate fail twice each; strict-JSON/browser and JSON5/no-browser controls pass; invalid input rejects.bee52204c7ff: all six JSON5/browser operations pass; check/validate preserve manifest bytes; builds recreate the actual browser asset. Same controls pass and invalid input retains existing errors.An initial path-capture mistake ran candidate source/tests and install lifecycle on the host. Those results were discarded, matching processes were absent, and both sides were rerun correctly; see the proof note.
Risk
Two-way door: reverting restores the previous parser. Blast radius is plugin-authoring browser builds and the repository asset helper. No new settings, dependencies, API, schema, permissions or runtime activation behavior.