Repository navigation
fix(installer): macOS onboarding cannot install plugins after the shell installer - #200257
miguelbranco80 wants to merge 1 commit into
Conversation
The shell installer reattached stdin with `/dev/tty` before running onboarding, Doctor, and plugin updates. macOS resolves `/dev/tty` against the caller's session on every use. OpenClaw starts npm and other helpers detached (in a new session) for process-tree cleanup, so a Node grandchild that inherited `/dev/tty` aborted at startup with `Assertion failed: (err) == (0)`, and first-run onboarding could not install the Codex plugin. Pass the controlling terminal's own device (for example `/dev/ttys003`), resolved with `ps`, and fall back to `/dev/tty` when it cannot be resolved. Linux was unaffected, because opening `/dev/tty` there binds to the real device. Fixes openclaw#200244
|
🦞👀 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 real behavior proof before merge. What this changesThe installer gives OpenClaw the terminal’s concrete device instead of the /dev/tty alias when handing off interactive input. Example: On macOS 26.6.2 with Node 24.22.1, install @openclaw/[email protected] after a piped shell-installer handoff.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR addresses a concrete stable-release onboarding failure with a focused fix at the installer boundary; no introduced correctness defect was found. Priority: P0 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe shell installer prepares stdin for onboarding and upgrade commands; plugin installation then reaches npm through the shared process runner, which detaches children for process-tree cleanup. flowchart TD
A[Piped shell installer] --> B[Terminal device selection]
B --> C[Onboarding or upgrade commands]
C --> D[Plugin installation]
D --> E[Shared process runner]
E --> F[Detached npm child]
Technical reviewBest possible solution: Keep terminal-device selection in the installer so the existing onboarding wizard can install plugins without requiring terminal recovery. Do we have a high-confidence way to reproduce the issue? The linked report provides a controlled macOS reproduction and native assertion, and current main retains the matching detached-child and inherited-stdin path; this read-only review executed no product code. Is this the best way to solve the issue? Resolving the concrete terminal at the installer fixes the descriptor producer, covers the affected handoffs, and preserves interactive input and process-tree cleanup without adding caller-specific npm workarounds. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bd25e9ef60cc. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +17, Other +13. Total +30 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 16, 2026, 4:15 PM ET / 21:15 UTC. |
Closes #200244
Supersedes #200247
What Problem This Solves
Fixes: first-run macOS onboarding fails with
Install failed: Codex(npm view failed … Assertion failed: (err) == (0)) when OpenClaw is installed withcurl -fsSL https://openclaw.ai/install.sh | bash.User Impact
macOS users who install with the shell installer can finish onboarding, including plugin installs, without leaving the wizard. Upgrades that run
openclaw doctor --fixandopenclaw plugins update --allfrom the installer get the same fix. Linux and Windows behavior is unchanged. No settings or migration are needed.Why This Change Was Made
curl | bashgives the installer a pipe for stdin, so before onboarding it reattached stdin withexec </dev/tty. OpenClaw starts npm and other helpers detached, in a new session, so it can clean up their process trees. On macOS,/dev/ttyrefers to "the calling process's terminal" every time it is used. A detached Node child has no terminal, so its startup terminal check fails and Node aborts. On Linux, opening/dev/ttybinds to the real device, so the same path works.The installer now hands OpenClaw the terminal's own device, such as
/dev/ttys003, resolved withps -o tty=. It falls back to/dev/ttywhen that is unavailable. This fixes every detached child at the one place the/dev/ttyalias was created, so the roughly 80killProcessTreecall sites do not need individual stdin workarounds. That is why this replaces #200247, which patched six npm call sites.Evidence
/bin/bash, likecurl | bash. It sources this branch'sinstall.sh, runs the handoff, thenopenclaw plugins install npm:@openclaw/[email protected]with throwaway state:exec </dev/tty):npm view failed: # node[…]: void node::PlatformInit(…) at ../src/node.cc:613 # Assertion failed: (err) == (0), which is the error in [Bug]: OpenClaw macOS onboarding crashes when detached npm inherits /dev/tty #200244./dev/ttys007):Installed plugin: codex./dev/ttyexits with SIGABRT. The real/dev/ttysNNNdevice, normal terminal stdin, and/dev/ttywithout detaching all exit 0.test/scripts/install-sh.test.tspasses 233 of 233. That includes a new test for the device lookup: the reported device whenpsgives one, and/dev/ttywhenpsprints??or fails. The handoff and stdin-routing tests are updated. Format and lint are clean, andbash -npasses under macOS/bin/bash3.2.gpt-6.1-sol, branch mode, P0–P2, withsrc/process/exec-runner.tsas source context) on head6161543against base2435c1fwasscoped-clean, with no findings. The branch was then rebased ontobd25e9e, which does not touch installer files, so the patch is unchanged.