Skip to content

fix(plugins): git update aborts with build-dirty when NODE_ENV=production rebuilds the workboard Control UI - #139075

Merged
steipete merged 1 commit into
openclaw:mainfrom
ylcn91:fix/update-clean-check-plugin-build-outputs
Sep 7, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
ylcn91:fix/update-clean-check-plugin-build-outputs

Conversation

@ylcn91

@ylcn91 ylcn91 commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #138684.

What Problem This Solves

Fixes Git-checkout updates that stop the Gateway and then abort with build-dirty because building the workboard Control UI changes its tracked plugin manifest. The rollback build can hit the same problem and leave the service stopped with rollback-checkout-dirty.

Why This Change Was Made

Browser asset builds now use the existing source-first SDK and workspace alias resolution. Under NODE_ENV=production, automatic resolution preferred existing compiled output; compiling those inputs produces different bundle bytes and manifest hashes, even when the source revision has not changed. Old compiled output can also embed stale code.

The repair belongs in the asset producer. The updater's clean-check guard remains intact, and packaged installations still fall back to compiled files when source is unavailable. Runtime loader preferences are unchanged.

User Impact

Production-mode Git-checkout builds use the checked-out sources consistently, preventing this generated-manifest failure during forward updates and rollback builds.

Thanks @ylcn91. The contributor's commit and authorship are preserved through rebase.

Evidence

Baseline: 6aa09cbadb594c3d46d5bd49a28c514df1b256b0. Reviewed and pushed head: 2f5d6f00ab6d899feb2bb82f4ca8ce2727f85a45.

  • Reproduced on main: NODE_ENV=production pnpm build succeeded with a clean tree. A subsequent NODE_ENV=production pnpm plugins:assets:build --plugin workboard changed the tracked manifest hash from 045246ad… to 072f0b70…. Rebuilding with NODE_ENV unset restored the committed hash and clean tree. No source transition was required.
  • Isolated Linux, Node 24.19.0, pnpm 12.3.4: pnpm check:changed --base 6aa09cbadb5 passed. Focused browser-builder, authoring-command, and SDK-alias suites passed: 113 passed, 1 skipped.
  • Red/green: the new stale-dist regression failed against main's production builder with different development/production hashes, then passed with the candidate restored.
  • NODE_ENV=production pnpm plugins:assets:check passed; generated plugin assets match committed bytes.
  • Actual compiled-package comparison: after generating workspace package output with the canonical build, main's producer changed the real workboard manifest to b695b7a3…. Restoring only the candidate builder and rebuilding in the same production environment restored 045246ad… and a clean tracked checkout.
  • Independent Codex P2 review: scoped-clean. The installed esbuild declarations independently confirm the existing alias?: Record<string, string> contract; this change only selects the existing source-first resolver mode.
  • Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/34148756205. Final exact-head verification is green: 132 successful checks, 42 skipped, and 1 neutral; no pending or failed checks.

The build boundary is exercised directly. A complete live managed-Gateway update/rollback cycle was not run; its unchanged dirty-check and recovery paths were inspected.

@clawsweeper

clawsweeper Bot commented Sep 5, 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 size: S labels Sep 5, 2026
@ylcn91
ylcn91 marked this pull request as ready for review September 5, 2026 12:27
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. labels Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 2:05 PM ET / 18:05 UTC.

ClawSweeper review

What this changes

Makes plugin browser builds prefer checked-out SDK and workspace sources over compiled output, with regression coverage for production-mode builds.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: current main retains the faulty resolution path, and the supplied real workboard builds demonstrate the repaired behavior. No actionable correctness or security findings remain.

Likely related people: steipete is a routing candidate based on recent area history and review context; exact source-line attribution remains unverified.

Priority: P1
Reviewed head: 2f5d6f00ab6d899feb2bb82f4ca8ce2727f85a45

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful regression coverage and sufficient real build evidence.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured Linux workboard asset-build comparison exercises the changed producer with actual compiled workspace output and shows the candidate restoring the committed manifest hash and clean checkout. This proves the repaired build boundary; it does not claim a full managed-Gateway update/rollback run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured Linux workboard asset-build comparison exercises the changed producer with actual compiled workspace output and shows the candidate restoring the committed manifest hash and clean checkout. This proves the repaired build boundary; it does not claim a full managed-Gateway update/rollback run.
Evidence reviewed 10 items Verified introduced change: The merge-base-to-head diff changes only browser-builder alias preference and adds a stale-dist regression. The host-verified test merge likewise changes only these two files.
Current main still needs the repair: Fetched main still calls the alias resolver without the explicit source preference. The resolver's automatic mode prefers compiled output under NODE_ENV=production.
Existing fallback and cache contract: The existing source preference orders candidates as source then dist; SDK and workspace resolution retain compiled fallback when source files are absent. Cache keys include the effective candidate order, so this does not change runtime callers or mix resolution modes.
Findings None None.
Security None None.

How this fits together

Plugin browser builds turn plugin UI source and host SDK imports into immutable assets whose hashes are recorded in the plugin manifest. Git-checkout updates require those tracked manifests to remain clean after rebuilding.

flowchart LR
  A[Plugin UI source] --> C[Browser asset builder]
  B[SDK and workspace imports] --> D[Prefer source with compiled fallback]
  D --> C
  C --> E[Content-hashed assets]
  E --> F[Plugin manifest]
  F --> G[Update clean-check]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +4, Tests +44. Total +48 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 1 +4
Tests 1 44 0 +44
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 49 1 +48

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #138684
Summary: This PR addresses the demonstrated production-build manifest drift in the linked outage report; the issue remains open until resolution.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep browser asset generation tied to checked-out sources while retaining compiled fallback and the updater's clean-check protection.

Do we have a high-confidence way to reproduce the issue?

Yes: current source exposes the production-mode dist preference, and the supplied real workboard comparison reproduces manifest drift with compiled artifacts present. This read-only review did not execute builds.

Is this the best way to solve the issue?

Yes: selecting the existing source-first resolver at the asset producer is a narrow repair that preserves packaged fallback and avoids weakening update safety checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4109aab58c14.

Labels

Label justifications:

  • P1: The reported build drift can abort a managed Git-checkout update and its rollback, leaving the Gateway stopped.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured Linux workboard asset-build comparison exercises the changed producer with actual compiled workspace output and shows the candidate restoring the committed manifest hash and clean checkout. This proves the repaired build boundary; it does not claim a full managed-Gateway update/rollback run.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured Linux workboard asset-build comparison exercises the changed producer with actual compiled workspace output and shows the candidate restoring the committed manifest hash and clean checkout. This proves the repaired build boundary; it does not claim a full managed-Gateway update/rollback run.

Evidence

What I checked:

  • Verified introduced change: The merge-base-to-head diff changes only browser-builder alias preference and adds a stale-dist regression. The host-verified test merge likewise changes only these two files. (src/cli/plugins-control-ui-build.ts:54, 2f5d6f00ab6d)
  • Current main still needs the repair: Fetched main still calls the alias resolver without the explicit source preference. The resolver's automatic mode prefers compiled output under NODE_ENV=production. (src/cli/plugins-control-ui-build.ts:50, 4109aab58c14)
  • Existing fallback and cache contract: The existing source preference orders candidates as source then dist; SDK and workspace resolution retain compiled fallback when source files are absent. Cache keys include the effective candidate order, so this does not change runtime callers or mix resolution modes. (src/plugins/sdk-alias.ts:1164, 2f5d6f00ab6d)
  • Real production entrypoint: Workboard's asset hook invokes this script, which calls the changed browser builder and writes its returned content-hashed declaration into the tracked manifest. (scripts/build-plugin-control-ui.mts:34, 2f5d6f00ab6d)
  • Captured after-fix build proof: The fully supplied PR body, captured under context sourceRevision 8efc261d0f41a8eec71ee79f8e4ca2bba78f655fb3c2eb4cd3dd6552f43b45f2, identifies baseline 6aa09cb and reviewed head 2f5d6f0. On isolated Linux with Node 24.19.0 and pnpm 12.3.4, the real production workboard build changed the manifest hash with main's producer; restoring the candidate producer restored the committed hash and clean checkout. It also records a passing production assets check and a failing-before/passing-after regression. A complete managed-Gateway update/rollback cycle was explicitly not run. (2f5d6f00ab6d)
  • Dependency boundary: The browser builder passes its alias map through buildPluginBundle to esbuild.build. This is an esbuild contract dependency; no changed behavior or proof claim depends on the Codex harness. (src/cli/plugins-build-bundle.ts:54, 2f5d6f00ab6d)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-05T12:35:58.332Z sha 47cd139923a4158563128f4d3d34a187e2562846 :: blocked before merge. :: none
  • reviewed 2026-09-05T12:52:40.744Z sha 47cd139923a4158563128f4d3d34a187e2562846 :: blocked before merge. :: none
  • reviewed 2026-09-05T12:59:22.815Z sha 47cd139923a4158563128f4d3d34a187e2562846 :: blocked before merge. :: none
  • reviewed 2026-09-07T17:49:19.328Z sha 2f5d6f0 :: needs maintainer review before merge. :: none

@ylcn91

ylcn91 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — added the esbuild alias contract (esbuild@0.28.2, alias?: Record<string, string>) to the Evidence section to cover the reviewer limitation behind the remaining merge-risk item. No code changes since 47cd139.

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

…NV=production

Git-checkout updates aborted with build-dirty (and the rollback build with
rollback-checkout-dirty) because extensions/workboard/openclaw.plugin.json
came out of the build with a different content hash. With NODE_ENV=production
the plugin loader alias map preferred compiled dist artifacts left behind by
the previous build over the checked-out sources, so the browser bundle bytes
and their hash depended on leftover build output instead of the revision.

Resolve SDK and workspace aliases source-first for plugin Control UI builds.
Source checkouts now always bundle src; packaged installs still fall back to
dist because they have no src.

Closes openclaw#138684
@steipete
steipete force-pushed the fix/update-clean-check-plugin-build-outputs branch from 47cd139 to 2f5d6f0 Compare September 7, 2026 17:43
@steipete
steipete merged commit 3fbd8f5 into openclaw:main Sep 7, 2026
181 checks passed
@steipete

steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 8, 2026
…NV=production (openclaw#139075)

Git-checkout updates aborted with build-dirty (and the rollback build with
rollback-checkout-dirty) because extensions/workboard/openclaw.plugin.json
came out of the build with a different content hash. With NODE_ENV=production
the plugin loader alias map preferred compiled dist artifacts left behind by
the previous build over the checked-out sources, so the browser bundle bytes
and their hash depended on leftover build output instead of the revision.

Resolve SDK and workspace aliases source-first for plugin Control UI builds.
Source checkouts now always bundle src; packaged installs still fall back to
dist because they have no src.

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

Labels

cli CLI command changes P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: self-update leaves gateway stopped when workboard plugin's build-hash manifest fails the clean-checkout safety check

3 participants