Skip to content

fix(node): start managed nodes when descriptor reception is blocked - #186282

Closed
Kimiyu-186 wants to merge 1 commit into
mainfrom
codex/strands-launcher-byte-pipe
Closed

Kimiyu-186 wants to merge 1 commit into
mainfrom
codex/strands-launcher-byte-pipe

Conversation

@Kimiyu-186

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes managed node startup under process sandboxes that deny descriptor reception, including Strands Box. Node IPC uses recvmsg even though the launcher exchanges only JSON control messages.

User Impact

Node.js on macOS and Linux can bootstrap, report readiness, and restart managed nodes without granting descriptor import. Bun, Windows, and installed packages without the new capability retain their existing native IPC path. The Box qualification uses Node.js; this does not claim Bun support under Box's descriptor-reception denial.

Why This Change Was Made

The launcher owns executable selection and this parent/child channel. It selects byte-pipe-v1 from the selected package manifest and uses length-prefixed JSON on a private inherited stream. Frames are limited to 1 MiB; queued writes to 256 messages and 4 MiB. Invalid frames close the channel, and a child stops if its supervisor disconnects.

Keeping transport selection in the launcher preserves mixed-version updates without an OCE preload duplicating launcher lifecycle or monkey-patching process.send. Executable selection, restart authorization, pairing, and sandbox policy remain unchanged. The necessary growth is the bounded transport, narrow client wiring, two real-child regressions, and one existing legacy-runtime case.

Bun retains native IPC because the repository's pinned Bun 1.4.4 does not consume inherited socket data through net.Socket({ fd }) in a minimal ping/pong reproduction. Selecting the byte transport there regressed existing startup tests; retaining native IPC restores them. The same socket reproduction works with Node 24.22.1.

Evidence

Current branch, macOS ARM64:

  • Native launcher suite with Node 24.22.1: 14/14 passed. Vitest wall time 25.02 s, test time 4.77 s. Includes 80 KiB bootstrap data, byte-only operation, invalid-frame termination, readiness, restart, rollback, and mixed-version transport.
  • Same suite with pinned Bun 1.4.4: 13 passed, 1 inapplicable byte-transport test skipped; 7.47 s wall, 2.31 s tests. Existing Bun startup passes on the original base as well.
  • Regression control on original launcher/client at d884222b50d0c48ed44846da920b99ebb5807c47: the new bootstrap case fails because it observes native IPC; the fixed Node case observes no native IPC. Payload delivery itself succeeds in both, so this is not a setup failure.
  • Repository focused typecheck, lint wrapper, formatting, and git diff --check pass. No dependency-version or lockfile changes. CI time and broad/platform CI remain pending.

Separate installed integration evidence: the backport on pinned OpenClaw f8386bc7df0a6c9eda7a28ae81943c5c06a414ff passed 33/33 native OCE cases and actual VM stop/start recovery on Linux ARM64, including remote Harness, files, skills, local semantic memory, and code mode. Runtime digest: sha256:8829c6bf6230d4c0ab4aa3a55b5c9822ce245149fc749607239609d954c63d08. The image build passed 32 pinned-source launcher cases; descriptor reception stayed denied. These results qualify that pinned backport, not a full installed E2E of this main-branch port. Windows has not been runtime-tested locally.

Draft for review. Independent autoreview is unavailable with the installed CLI/account model combination. The author approved a draft-only waiver; independent review still blocks merge. No merge or readiness promotion is requested.

@clawsweeper

clawsweeper Bot commented Oct 27, 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 docs Improvements or additions to documentation size: M labels Oct 27, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR adds a bounded JSON byte stream so managed Node.js nodes can start without descriptor reception.

Example: A managed node runs with Node.js 24.22.1 on Linux under a sandbox denying descriptor reception.

  • Before: The launcher uses native IPC, whose recvmsg operation is blocked.
  • After: A package advertising byte-pipe-v1 exchanges bootstrap, readiness, and restart messages through an inherited stream.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused implementation is stronger than the supplied proof tier.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Managed nodes cannot start when a process sandbox denies the descriptor-reception operation used by native IPC.
Reason: The repair removes an unnecessary transport requirement without relaxing sandbox policy or introducing a competing lifecycle owner; the supplied maintainer-authored designation establishes direction.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it addresses an owned launcher startup failure, preserves existing lifecycle ownership, and has no concrete introduced defect identified.

Priority: P2
Reviewed head: b0435dc33d6ec0e5aa022aa1b8dc47d50c909846

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Show this port's installed node bootstrap, authenticated readiness, restart, and supervisor-loss behavior with descriptor reception denied, including an upgrade from v2026.10.8 preserving pairing, settings, and state.
Agent review details

How this fits together

The package launcher selects and supervises the node runtime; its private control channel carries bootstrap settings, authenticated-readiness notifications, and update restart requests.

flowchart TD
  A[Installed CLI or node service] --> B[Node host launcher]
  B --> C[Selected package manifest]
  C --> D[Byte stream or native IPC]
  D --> E[Node launcher client]
  E --> F[Node runtime and Gateway connection]
  F --> E
Loading

Technical review

Best possible solution:

Keep transport adaptation inside the existing launcher while preserving manifest-selected compatibility with installed runtimes.

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

Current main unconditionally creates native IPC for managed children, establishing the reported dependency on descriptor reception; sandbox failure was not independently executed in this read-only review.

Is this the best way to solve the issue?

The smallest complete repair is transport adaptation in the existing supervisor and client: bootstrap, readiness, restart authorization, executable selection, and persisted-state ownership remain with their current owners.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Supervisor control channel and activation lifecycle keeps the original intent (3c4c111: A stable supervisor activates private node runtimes only after authenticated readiness while retaining pairing, launch options, cooldown, and rollback.)
  • Child executable and argument selection keeps the original intent (3bfccdb: The shared invocation owner distinguishes loose runtime/script arguments from standalone executable arguments.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction and current-main comparison: The introduced diff contains the five supplied paths. Current main retains the original native-IPC launcher and client; comparison of those owners against the merge base showed no intervening changes. (node-host-launcher.mjs:510, b0435dc33d6e)
  • Transport and lifecycle ownership: The launcher selects the transport from the selected package, retains native IPC for Bun, Windows, and packages without the capability, and preserves the existing readiness, activation, rollback, and restart checks. (node-host-launcher.mjs:506, b0435dc33d6e)
  • Distinct regression contracts: The added real-child cases cover bootstrap delivery without native IPC and termination after an oversized frame; the existing restart case now explicitly exercises a legacy candidate package. (test/node-host-launcher.test.ts:276, b0435dc33d6e)
  • Full supplied proof and discussion inspected: The complete body distinguishes current-branch launcher-suite results from installed Linux evidence for backport f8386bc. It provides no linked recording, logs, or terminal artifact for this port and explicitly retains draft-only intent. Both discussion comments are bot status messages, with no review comments or approvals. Captured body source identity: b63b6947c02279602df874e36ae40f47930d89a29d2656a62c9e45f3c35fb53b. (b0435dc33d6e)
  • Feature history and original intent: feat: automatically update idle headless nodes #151545 introduced the stable supervisor and authenticated-readiness activation boundary; fix: preserve standalone CLI profiles and settle Doctor shutdown #173154 centralized executable invocation; fix(node): restore automatic updates for installed node services #175860 restored service entry through that supervisor. This PR retains those responsibilities. (node-host-launcher.mjs:359, a189175a709b)
  • Review policy and inspection limits: Read the complete root, docs, and test AGENTS.md files and applied simplification and test-value guidance. The maintainer-notes directory is absent. Following launcher-client history reached an unavailable historical blob; scoped history, the introduction commit, current-main blame, and relevant prior PR bodies remained readable. No target code or tests were executed, and the checkout remained clean. (AGENTS.md:1, b0435dc33d6e)

Likely related people:

  • Peter Steinberger: Raw commit 3c4c111 adds node-host-launcher.mjs:201 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3c4c111b0f71; files: node-host-launcher.mjs)

PR surface

Source +21, Tests +42, Docs +7, Config +1, Other +100. Total +171 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 29 8 +21
Tests 1 43 1 +42
Docs 1 7 0 +7
Config 1 1 0 +1
Generated 0 0 0 0
Other 1 113 13 +100
Total 5 193 22 +171

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The startup failure affects managed nodes in descriptor-restricted sandboxes, with a limited deployment scope.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Provide the installed current-port sandbox and latest-stable upgrade evidence described in the proof assessment.

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.

Reviewed October 27, 2026, 4:48 PM ET / 20:48 UTC.

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

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M 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.

1 participant