Skip to content

fix(plugins): JSON5 manifests fail Control UI builds - #198808

Merged
obviyus merged 3 commits into
openclaw:mainfrom
Alix-007:alix/fix-plugin-ui-json5-20261114
Nov 14, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
Alix-007:alix/fix-plugin-ui-json5-20261114

Conversation

@Alix-007

@Alix-007 Alix-007 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Related: #190192

What Problem This Solves

Valid JSON5 manifests fail plugins build, plugins build --check and plugins validate when the plugin declares a Control UI browser entry. The shared browser builder rereads them with strict JSON.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 --copy remains source-free.

Evidence

Paired command results, controls, manifest/asset hashes and isolation note.

  • Base 08ae8c62b83e: JSON5/browser build/check/validate fail twice each; strict-JSON/browser and JSON5/no-browser controls pass; invalid input rejects.
  • Head 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.
  • Source-tier base uses host ocx scratch; candidate runs in a secretless Node 24.22.1 container with isolated state. Vitest-source regression: base 4 failed / 27 passed, candidate 31 passed, plus all three existing script tests pass (including source-free copy). Candidate formatting, lint, full build with declarations, and packed runtime/SDK smoke pass in that container.

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.

@clawsweeper

clawsweeper Bot commented Nov 14, 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.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes scripts Repository scripts size: XS labels Nov 14, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 14, 2026
@clawsweeper

clawsweeper Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

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

  • Before: Plugin build, build --check, and validate reject the valid manifest.
  • After: All three commands succeed, and check and validation preserve the manifest bytes.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused contract repair with paired CLI proof, meaningful regression coverage, and no open findings; normal CI remains pending.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): obviyus supplies exact-head CLI results from isolated synthetic plugins in a secretless Node 24.22.1 container: build/check/validate pass with JSON5 browser manifests, builds recreate assets, checks preserve bytes, and controls retain existing behavior; final script tests also cover source-free copying.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Plugin authors cannot build or validate documented JSON5 manifests when their plugin includes browser assets.
Reason: The change restores an existing documented format contract without adding settings, dependencies, or public APIs.

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
Reviewed head: bee52204c7ffeecf5422a7c93d47b49a0e916f86

Before merge

None.

Findings

None.

Agent review details

How this fits together

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

Technical review

Best 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

  • CLI browser manifest reading keeps the original intent (dbd0a21: The Settings extraction retained authored browser presentation while moving presentation into plugins; strict parsing was not a stated product requirement.)
  • Repository browser-build helper and copy isolation keeps the original intent (adb834d: Asset copying intentionally avoids compiler and source-metadata machinery; the final head keeps the new reader inside the build branch.)
  • Authored-manifest preservation regression keeps the original intent (68b932a: Runtime browser builds must preserve authored manifests and publish derived declarations separately; the changed fixture retains those assertions.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +1, Tests 0, Other 0. Total +1 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 9 8 +1
Tests 1 1 1 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 2 0
Total 3 12 11 +1

Preflight source

Source 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

Metric Value Why it matters
Production versus test delta Production +11/-10; tests +1/-1 The small production increase reuses the existing parser and preserves missing-file handling; existing integration cases supply regression coverage without new scaffolding.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Documented JSON5 manifests break browser-enabled plugin authoring commands, with limited impact on plugin developers.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-11-14T10:33:07.616Z sha 769d226 :: blocked before merge. :: none
  • reviewed 2026-11-14T11:33:58.605Z sha 081de1e :: needs maintainer review before merge. :: none

Reviewed November 14, 2026, 7:03 AM ET / 12:03 UTC (Revision 3).

@obviyus

obviyus commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@obviyus

obviyus commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Verified the user-facing authoring commands on base 08ae8c62b83ede02db3a8d2bc3ce36206008d253 and candidate bee52204c7ffeecf5422a7c93d47b49a0e916f86.

The shipped plugins build command calls buildPluginControlUi directly through plugins-authoring-command.ts; it does not invoke scripts/build-plugin-control-ui.mts. The CLI change independently fixes the shipped path. The script change fixes a separate repository helper.

Source-tier proof used isolated synthetic plugins, config and state: base through host ocx src in its base scratch; candidate through node --import tsx src/entry.ts inside a secretless node:24.22.1 container.

Scenario Base Candidate
JSON5 comments + trailing comma, browser entry: build/check/validate, twice each All six exit 1 All six exit 0
Strict JSON + browser entry All three pass All three pass
JSON5 without browser entry All three pass All three pass
Truly invalid manifest All three reject Same existing errors

Each failing base browser command printed The CLI command failed. and the existing doctor-help line. The regression test exposes the underlying SyntaxError: Unexpected token '/'. Invalid input still reports Malformed JSON in ... for build/check and failed to parse plugin manifest: SyntaxError: JSON5: invalid character '!' at 1:11 for validate on both sides.

Before each build, generated browser assets were removed. Both candidate builds recreated index.js (43 bytes, containing the fixture marker; SHA256 719cbb7aa711700930c9be1aaa219c9583e429d340f63a3ad9a39ffdcdceeb8e). Candidate check/validate preserved the JSON5 manifest SHA256 0b13d83978bde22b253252787ec46be43783e5761fb4195b277809ff281f93a0 in both repetitions.

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 full-tier packed smoke (scripts/release-check.ts) passes in the same container, including installed CLI/runtime and SDK consumer compilation. Its initial run hit restrictive staging-directory requirements; rerunning with a private TMPDIR and umask 077 passed without product changes.
CI also caught a real regression in the contributor script change: eager loading of the source reader broke source-free --copy. The reader now loads only in the build branch. All three existing script tests pass in the final candidate container, including the source-free copy case; no tests were added or removed for this repair.

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.

@clawsweeper

clawsweeper Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Nov 14, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. labels Nov 14, 2026
@obviyus

obviyus commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 14, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 14, 2026
@obviyus
obviyus merged commit 45e2704 into openclaw:main Nov 14, 2026
136 of 138 checks passed
@obviyus

obviyus commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

Landed in 45e2704. Thanks @Alix-007.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 15, 2026
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]>
@Alix-007

Copy link
Copy Markdown
Contributor Author

Thanks @obviyus for testing the authoring commands, invalid-manifest controls, and repeated builds, and for landing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants