Repository navigation
fix(update): prevent private Node installation after authority is lost - #154334
Conversation
Keep the private Node installer behind the existing native stdin gate until the updater revalidates requester identity and binds the child to its installation owners. Refused input can no longer let a stdin-independent installer mutate the private runtime before cancellation.
|
🦞👀 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. Reviewed September 21, 2026, 3:56 AM ET / 07:56 UTC (Revision 7). ClawSweeper reviewWhat this changesThe PR makes private Node installation and retained-service commands share an admission gate that delays execution and Node startup hooks until authorization checks pass, with native validation and documentation. Merge readiness✅ Ready for maintainer review This remains a useful fix that current main does not contain. No blocking defect was found, and the new, source-qualified evidence satisfies the previous authority and upgrade proof requests. Priority: P2 Review scores
Verification
How this fits togetherThe updater provisions a private Node runtime when an update needs a compatible version. Its execution owner checks the requester and installation leases before allowing the installer to change files, then joins child cleanup before releasing ownership. flowchart TD
A[Update request] --> B[Requester and installation checks]
B --> C[Private admission pipe]
C --> D{Admission valid?}
D -->|No| E[Refuse without installer effects]
D -->|Yes| F[Restore options and run native command]
F --> G[Join cleanup and release leases]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +50, Tests +429, Docs +3, Config +38, Other 0. Total +520 across 10 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one shared native admission gate under the existing updater authority and cleanup owners, preserving authorized provisioning and payload environment semantics. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the failure path: current main starts the installer before beforeInput can reject it, so a stdin-independent installer can write first. This review did not execute a current-main reproduction. Is this the best way to solve the issue? Yes. Reusing the retained-service gate closes the execution gap at the existing owner, and deferring NODE_OPTIONS prevents startup hooks from bypassing admission. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 11263ceb18ca. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
Validation update for unchanged
Still open: forced private-Node provisioning, admission, and cleanup on native Linux and Windows. The two additional original two-worker CLI replays recorded as in progress in the PR body also have no public completion receipt yet. Those are the author's stated validation commitments. Keeping the PR open for these concrete proof gaps; the generic upgrade pass does not establish forced runtime provisioning. |
openclaw#154334) * fix(update): gate Node provisioning on live ownership Keep the private Node installer behind the existing native stdin gate until the updater revalidates requester identity and binds the child to its installation owners. Refused input can no longer let a stdin-independent installer mutate the private runtime before cancellation. * test(update): prove native private Node provisioning * fix(ci): route private Node live proof in release shards * test(ci): preserve private Node proof isolation expectations * fix(update): defer native preload options until admission * test(update): satisfy native gate fixture lint --------- Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Private Node provisioning can start an installer before the updater's final request-identity and installation-ownership checks reject it. A refused update can therefore still begin changing its private runtime.
User Impact
An update that loses authority before installer admission leaves the private runtime untouched. Authorized provisioning continues through the existing updater and process-cleanup owners.
Why This Change Was Made
Reuse retained-service recovery's native command gate for Node provisioning. The gate holds the installer behind a private input pipe until the updater rechecks the requester and binds the child to its installation owners. Empty or malformed input refuses launch.
Node evaluates inherited
NODE_OPTIONSbefore the gate itself. The shared owner now removes those options from the control process, sends them through the private admission input, and restores them only for the admitted payload. Canonical Windows environment precedence is preserved. Exact byte-length, UTF-8 and frame validation reject invalid input without printing private values. No new runtime option, dependency or migration.The shared boundary adds 50 net runtime lines and removes the retained-service copy of the gate. Validation tooling adds 38 net lines, tests add 429, and documentation adds 3. The live fixture exercises actual private Node provisioning, native version/SQLite, child settlement, lease release/reacquisition, cached reuse and owned-root cleanup. Linux runs all 40 auxiliary controls; the narrow Windows mode selects 28 portable controls. It does not claim persistent custody of escaped descendants from a dead root process.
Evidence
Final candidate:
ac003e46479135318897fa692ba2007f57e1d12e, retaining the signed integration of frozen maincfb4e33b8e2c8591f33369587f59154bc93ec2c3.07b4e12review found the startup-preload admission defect. Deterministic controls on that unchanged source confirmed both--requireand--importwrote a preload marker despite empty-input rejection. The repaired9c10a34native tests cover rejected input, admitted payload-only hooks, retained-service recovery, fragmented Unicode, invalid frames, absent/empty options and Windows casing.9c10a34→ac003e4changes only five required braces in the auxiliary test after a CI lint failure. Conditions, assignments, order, assertions, selection, runtime, workflow and install inputs are unchanged. The executions below tested9c10a34and are reused with that explicit syntax-only distinction.CI=1 node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/cli/update-cli/update-command-executor-auxiliary.test.tspassed with 0 warnings / 0 errors, 38.827 seconds, outer exit 0. Native sync retained remote Git HEAD9c10a34; its sole changed tracked file was blob97850c06e78705edf50c99b81352080a714fd987, making its content tree equivalent to committedac003e4. All other tracked bytes and frozen install inputs were unchanged. Formatting, diff and privacy checks pass.Native provisioning and authorization
9c10a34, live fixture 1/1 (test 6.577 seconds, file 12.90 seconds, wrapper 13.683 seconds) and 40/40 auxiliary controls (file 29.22 seconds, wrapper 31.441 seconds), outer exit 0. The source was clean after these commands.9c10a34; live fixture 1/1 (test 76.994 seconds, file 90.96 seconds) and 28 portable controls (12 unselected; file 89.05 seconds, wrapper 94.78 seconds). Actual Node 24.19.0/SQLite, installer settlement, installation leases, cached reuse and owned-fixture cleanup passed. Outer process-namespace retention remains governed by the existing descendant-custody limitation.673676456eca403fabc1797d094ce216078b2619(9c10a34plus69afbbaf), 387 files / 8,891 tests passed, one file / 51 tests skipped, 690.87 seconds (wrapper 694.05 seconds), exit 0. The completevitest.cli.config.tsran without filters or extra arguments, with a two-worker cap and group concurrency 1. All 40 auxiliary cases executed. This is correctness proof, not a performance comparison.Published retained-state upgrade
The same owned Linux Testbox ran one canonical
pnpm test:docker:allcell, with the existing selector restricted topublished-upgrade-survivor / legacy-operator-state, both baseline selectors pinned to[email protected], and restart modeauto-auth. Plan admission verified exactly one expanded lane and no tail or omitted lanes.The actual cell passed on its first attempt in 321 seconds, outer exit 0: installed published 2026.9.4 → candidate/installed 2026.9.5, through the updater, with authenticated restart and retained operator state. Startup took 7 seconds, update/restart 183 seconds, health/readiness 1 second each and status 2 seconds. Canonical package preparation took 389 seconds and tarball integrity verification passed.
The candidate tarball was 81,273,745 bytes, SHA-256
1d678eaf2eeb975b6142c887f0a190c57c6de5c32cc42fc44f2be75b5f031fb7; its build information records commit9c10a34d98d48f7a6a4bb26ec640b5c361154ce8. The source restored cleanly afterward. This proves the published upgrade/state path; forced private-runtime provisioning is covered by the separate native fixtures above. The task-owned lease is being stopped after the joined lint command; the holding workflow is not presented as CI proof.CI and review disposition
The latest
9c10a34ClawSweeper review found no code or security issue. Its before-merge and rank-up requests for real provisioning, allowed/refused admission, retained-service authority and published-state upgrade evidence are fulfilled by the receipts above.The
9c10a34CI wave had three distinct failures: the five curly-brace lint errors corrected here; an unchanged OpenAI transport socket-close assertion; and an unchanged staging wrapper timeout after a retained recovery lock. Independent owner inspection did not establish either latter failure's cause or justify a production patch. These remain named follow-up observations if they recur; no timeout, assertion or cleanup behavior was changed. Natural final-head CI supplies the next controls.The lineage also includes the separately reviewed canonical packaging repair and process-group fixture repair. The new live fixture is registered exactly once in the existing infrastructure release shard, preserving exhaustive coverage. The workflow guards preserve private-proof exclusion at the Scheduled Task job boundary. Focused workflow/inventory proof passed 49/49 tests on the previously recorded exact content tree.
Historical evidence and credit
The original installer-side-effect failure and reproducer credit remain with @steipete. The author's original-head
224890b5native/CLI reports remain attributed historical evidence. Earlier4ff1f5c,a2267eaaand8cad7d7native, CLI and Docker receipts are historical after the later gate and install-input changes; current proof is above. At4ff1f5c, focused Linux tests passed before an outer shell exit 2, and a second CLI replay lost transport and was interrupted when its obsolete owned lease was stopped. That replay remains unproven.Status at Publication
Final
ac003e4source, independent review and targeted lint are clear. Linux/Windows native, full CLI and published retained-state upgrade proof passed at the precisely attributed behavior-equivalent sources above. Automatic final-head CI, security and ClawSweeper qualification remain pending. Later gate results or material disposition will be recorded once with their actual source; no manual duplicate native or CLI execution is needed.