Repository navigation
fix(build): fail closed on symlinked build output roots - #116705
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 7:29 AM ET / 11:29 UTC. ClawSweeper reviewWhat this changesThis PR adds a shared Merge readinessKeep this PR open for the assigned maintainer’s normal landing path. The member comment explicitly accepts the intentional fail-closed compatibility policy, the patch has no concrete correctness finding, and the remaining gate is completion of the current exact-head required checks rather than a contributor repair. Priority: P0 Review scores
Verification
How this fits togetherOpenClaw’s source-build pipeline creates flowchart LR
A[Source build command] --> B[Build and postbuild mutators]
B --> C[Output-root safety check]
C -->|Missing or real root| D[Cleanup copy and staging]
C -->|Symlinked root| E[Actionable build failure]
D --> F[Generated dist trees]
F --> G[Runtime packaging and gateway startup]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +410, Docs +6, Other +90. Total +506 across 25 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the shared root-level guard after the in-progress required checks complete, retaining the documented migration to real output directories rather than restoring traversal into symlink targets. Do we have a high-confidence way to reproduce the issue? Yes. The PR supplies a concrete temporary-directory reproduction of preserve-aware cleanup mutating a symlink target on unpatched code and shows the patched paths throw before changing the target. Is this the best way to solve the issue? Yes. A shared root-level AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 95df2dfd6a61. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
436e873 to
687bfe6
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
687bfe6 to
3562737
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer decision: I accept the fail-closed compatibility policy. Generated Exact-head CI run: https://github.com/openclaw/openclaw/actions/runs/30622873936 All branch-relevant build, type, Windows, contract, boundary, and test lanes passed. Two exceptions are external to this diff:
Holding merge for the final current- |
7913631 to
03d5e25
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
A symlinked dist/dist-runtime root made preserve-aware cleanup recurse into the link target and delete it (incident: 12,809 files removed from a running gateway's tree). Add one shared lstat guard and apply it at every audited build/postbuild recursive mutator; the symlink and target stay unchanged and the build stops with an actionable error. Fixes openclaw#116498
…gh owner lane The scripts-lane test twin broke the changed-target routing pins for scripts/copy-bundled-plugin-metadata.mjs edits; move the symlinked-dist guard case into src/plugins/copy-bundled-plugin-metadata.test.ts. Related to openclaw#116498
03d5e25 to
160e0ee
Compare
|
@clawsweeper re-review |
|
ClawSweeper rank-up move disposition: no further rebase after the frozen merge slot. The branch was conflict-free rebased onto |
* commit 'd8f229f2e6c39e2dc694730c2efc479e4fb3871e': (59 commits) fix(setup): isolate failed channel probes and report doctor diagnostics (openclaw#116824) fix(telegram): preserve edit previews, message cache, and group history (openclaw#116818) fix(whatsapp): preserve interactive replies and normalize media MIME (openclaw#116816) fix(file-transfer): keep fetched media attachable in sandboxed replies (openclaw#116400) fix(browser): preserve doctor JSON failure status (openclaw#116811) fix(ollama): stream native tool call lifecycle (openclaw#116809) fix(matrix): preserve message-tool room thread routing (openclaw#116802) fix(ui): restore mobile navigation and accessible usage filters (openclaw#116751) fix(ui): coalesce profile identity refresh (openclaw#116764) fix(ui): preserve chat attachments and run ownership (openclaw#116752) fix(plugins): clean up partial service startup once (openclaw#116804) fix(qa-channel): enforce message and thread lifecycle ownership (openclaw#116801) fix(qa-lab): support groups and isolate thread timelines (openclaw#116803) feat(plugins): externalize Voyage embeddings (openclaw#116785) fix(outbound): strip echoed inbound metadata before delivery (openclaw#50520) fix(anthropic-vertex): correct multi-region endpoints (openclaw#116757) fix(ui): scope agent cron jobs and surface model catalog failures (openclaw#116771) fix(ui): preserve scoped session state across updates (openclaw#116772) fix(build): fail closed on symlinked build output roots (openclaw#116705) fix(commands): validate native settings and preserve Telegram ingress outcomes (openclaw#116773) ...
* origin/main: (52 commits) fix(setup): isolate failed channel probes and report doctor diagnostics (openclaw#116824) fix(telegram): preserve edit previews, message cache, and group history (openclaw#116818) fix(whatsapp): preserve interactive replies and normalize media MIME (openclaw#116816) fix(file-transfer): keep fetched media attachable in sandboxed replies (openclaw#116400) fix(browser): preserve doctor JSON failure status (openclaw#116811) fix(ollama): stream native tool call lifecycle (openclaw#116809) fix(matrix): preserve message-tool room thread routing (openclaw#116802) fix(ui): restore mobile navigation and accessible usage filters (openclaw#116751) fix(ui): coalesce profile identity refresh (openclaw#116764) fix(ui): preserve chat attachments and run ownership (openclaw#116752) fix(plugins): clean up partial service startup once (openclaw#116804) fix(qa-channel): enforce message and thread lifecycle ownership (openclaw#116801) fix(qa-lab): support groups and isolate thread timelines (openclaw#116803) feat(plugins): externalize Voyage embeddings (openclaw#116785) fix(outbound): strip echoed inbound metadata before delivery (openclaw#50520) fix(anthropic-vertex): correct multi-region endpoints (openclaw#116757) fix(ui): scope agent cron jobs and surface model catalog failures (openclaw#116771) fix(ui): preserve scoped session state across updates (openclaw#116772) fix(build): fail closed on symlinked build output roots (openclaw#116705) fix(commands): validate native settings and preserve Telegram ingress outcomes (openclaw#116773) ...
* commit 'd8f229f2e6c39e2dc694730c2efc479e4fb3871e': (60 commits) fix(setup): isolate failed channel probes and report doctor diagnostics (openclaw#116824) fix(telegram): preserve edit previews, message cache, and group history (openclaw#116818) fix(whatsapp): preserve interactive replies and normalize media MIME (openclaw#116816) fix(file-transfer): keep fetched media attachable in sandboxed replies (openclaw#116400) fix(browser): preserve doctor JSON failure status (openclaw#116811) fix(ollama): stream native tool call lifecycle (openclaw#116809) fix(matrix): preserve message-tool room thread routing (openclaw#116802) fix(ui): restore mobile navigation and accessible usage filters (openclaw#116751) fix(ui): coalesce profile identity refresh (openclaw#116764) fix(ui): preserve chat attachments and run ownership (openclaw#116752) fix(plugins): clean up partial service startup once (openclaw#116804) fix(qa-channel): enforce message and thread lifecycle ownership (openclaw#116801) fix(qa-lab): support groups and isolate thread timelines (openclaw#116803) feat(plugins): externalize Voyage embeddings (openclaw#116785) fix(outbound): strip echoed inbound metadata before delivery (openclaw#50520) fix(anthropic-vertex): correct multi-region endpoints (openclaw#116757) fix(ui): scope agent cron jobs and surface model catalog failures (openclaw#116771) fix(ui): preserve scoped session state across updates (openclaw#116772) fix(build): fail closed on symlinked build output roots (openclaw#116705) fix(commands): validate native settings and preserve Telegram ingress outcomes (openclaw#116773) ...
) Reject symlinked generated-output roots before build and postbuild mutation paths can recurse into unrelated targets. Cover aggregate, UI, export-template, bundled-plugin, Docker-prune, and plugin-runtime entry points with regression tests and migration guidance. Closes openclaw#116498 Co-authored-by: WangYan <[email protected]>
* commit '4e7fffdb98ce4d3e6fd69859bedd584cf474ec53': (59 commits) fix(setup): isolate failed channel probes and report doctor diagnostics (openclaw#116824) fix(telegram): preserve edit previews, message cache, and group history (openclaw#116818) fix(whatsapp): preserve interactive replies and normalize media MIME (openclaw#116816) fix(file-transfer): keep fetched media attachable in sandboxed replies (openclaw#116400) fix(browser): preserve doctor JSON failure status (openclaw#116811) fix(ollama): stream native tool call lifecycle (openclaw#116809) fix(matrix): preserve message-tool room thread routing (openclaw#116802) fix(ui): restore mobile navigation and accessible usage filters (openclaw#116751) fix(ui): coalesce profile identity refresh (openclaw#116764) fix(ui): preserve chat attachments and run ownership (openclaw#116752) fix(plugins): clean up partial service startup once (openclaw#116804) fix(qa-channel): enforce message and thread lifecycle ownership (openclaw#116801) fix(qa-lab): support groups and isolate thread timelines (openclaw#116803) feat(plugins): externalize Voyage embeddings (openclaw#116785) fix(outbound): strip echoed inbound metadata before delivery (openclaw#50520) fix(anthropic-vertex): correct multi-region endpoints (openclaw#116757) fix(ui): scope agent cron jobs and surface model catalog failures (openclaw#116771) fix(ui): preserve scoped session state across updates (openclaw#116772) fix(build): fail closed on symlinked build output roots (openclaw#116705) fix(commands): validate native settings and preserve Telegram ingress outcomes (openclaw#116773) ...
* origin/main: (52 commits) fix(setup): isolate failed channel probes and report doctor diagnostics (openclaw#116824) fix(telegram): preserve edit previews, message cache, and group history (openclaw#116818) fix(whatsapp): preserve interactive replies and normalize media MIME (openclaw#116816) fix(file-transfer): keep fetched media attachable in sandboxed replies (openclaw#116400) fix(browser): preserve doctor JSON failure status (openclaw#116811) fix(ollama): stream native tool call lifecycle (openclaw#116809) fix(matrix): preserve message-tool room thread routing (openclaw#116802) fix(ui): restore mobile navigation and accessible usage filters (openclaw#116751) fix(ui): coalesce profile identity refresh (openclaw#116764) fix(ui): preserve chat attachments and run ownership (openclaw#116752) fix(plugins): clean up partial service startup once (openclaw#116804) fix(qa-channel): enforce message and thread lifecycle ownership (openclaw#116801) fix(qa-lab): support groups and isolate thread timelines (openclaw#116803) feat(plugins): externalize Voyage embeddings (openclaw#116785) fix(outbound): strip echoed inbound metadata before delivery (openclaw#50520) fix(anthropic-vertex): correct multi-region endpoints (openclaw#116757) fix(ui): scope agent cron jobs and surface model catalog failures (openclaw#116771) fix(ui): preserve scoped session state across updates (openclaw#116772) fix(build): fail closed on symlinked build output roots (openclaw#116705) fix(commands): validate native settings and preserve Telegram ingress outcomes (openclaw#116773) ...
* commit '4e7fffdb98ce4d3e6fd69859bedd584cf474ec53': (60 commits) fix(setup): isolate failed channel probes and report doctor diagnostics (openclaw#116824) fix(telegram): preserve edit previews, message cache, and group history (openclaw#116818) fix(whatsapp): preserve interactive replies and normalize media MIME (openclaw#116816) fix(file-transfer): keep fetched media attachable in sandboxed replies (openclaw#116400) fix(browser): preserve doctor JSON failure status (openclaw#116811) fix(ollama): stream native tool call lifecycle (openclaw#116809) fix(matrix): preserve message-tool room thread routing (openclaw#116802) fix(ui): restore mobile navigation and accessible usage filters (openclaw#116751) fix(ui): coalesce profile identity refresh (openclaw#116764) fix(ui): preserve chat attachments and run ownership (openclaw#116752) fix(plugins): clean up partial service startup once (openclaw#116804) fix(qa-channel): enforce message and thread lifecycle ownership (openclaw#116801) fix(qa-lab): support groups and isolate thread timelines (openclaw#116803) feat(plugins): externalize Voyage embeddings (openclaw#116785) fix(outbound): strip echoed inbound metadata before delivery (openclaw#50520) fix(anthropic-vertex): correct multi-region endpoints (openclaw#116757) fix(ui): scope agent cron jobs and surface model catalog failures (openclaw#116771) fix(ui): preserve scoped session state across updates (openclaw#116772) fix(build): fail closed on symlinked build output roots (openclaw#116705) fix(commands): validate native settings and preserve Telegram ingress outcomes (openclaw#116773) ...
Closes #116498
What problem this solves
A source build could recursively delete files outside the checkout when a generated output root (
dist,dist-runtime, or a package-localdist) was a symlink. The reported incident deleted 12,809 generated files from a live gateway build tree and later causedERR_MODULE_NOT_FOUNDfailures.Fix
Build and postbuild mutation paths now fail closed when an output root is a symlink or junction. The shared guard:
lstaton the root itself;ENOENTas a missing root and propagates other filesystem failures;Maintainer policy decision: generated output roots must be real directories. Operators using symlinked output roots must replace them with real directories before building. This compatibility break is intentional because following the link can destroy unrelated data.
Evidence
Current exact head
160e0ee5e86a3b1f6e4f91ee6d681b20aa5854eais a conflict-free rebase onto the frozen merge slot82231b425b7f574e70c03bc32bb954a78bc3377b;git range-diffconfirms the three-commit patch is unchanged. Livemainthen advanced tob4e10e8a90f4e9d0d7adffff83a229cd83d9c8fcin an unrelated file set; the exact merge tree has zero touched-file overlap, the same stable patch id, and passesgit diff --check. The full build and broad changed-gate proof below were recorded on the identical patch tree at3562737b739a10b3a0af301f6f8c0a8adc6506f5, followed by final exact-head focused tests, format, lint, and diff validation.main; confirmed the vulnerable path inv2026.7.1andv2026.7.2-beta.5on Node 22.22.3, 24.15.0, and 26.5.0.test-roottsgo lane passed.pnpm buildpassed on the exact head in 5m33.6s, covering tsdown, runtime postbuild, bundled-plugin assets, plugin SDK exports, export templates, and UI verification.patch is correct, confidence 0.91.AI assistance
kimi-k3