Skip to content

fix(install): piped install-cli.sh --onboard fails after a successful install - #201430

Merged
vincentkoc merged 3 commits into
openclaw:mainfrom
LiuwqGit:feat/issue-201388-install-cli-onboard-tty
Nov 27, 2026
Merged

vincentkoc merged 3 commits into
openclaw:mainfrom
LiuwqGit:feat/issue-201388-install-cli-onboard-tty

Conversation

@LiuwqGit

@LiuwqGit LiuwqGit commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI-assisted: yes

Closes #201388

What Problem This Solves

Why This Change Was Made

  • Intended outcome: --onboard in the piped form runs onboarding reading from the user's terminal, the same handoff install.sh already uses; with --json the event stream on stdout stays parseable as independent NDJSON records; with no terminal available the installer defers onboarding with a visible setup command and keeps exit status 0.
  • Out of scope: onboarding's own TTY guard is unchanged (not weakened); install.sh is unchanged.
  • Highest-risk area: the terminal handoff at the end of main() in scripts/install-cli.sh.
  • How is that risk mitigated? The has_controlling_tty / controlling_tty_path helpers are copied from the merged sibling installer (scripts/install.sh, including the macOS [Bug]: OpenClaw macOS onboarding crashes when detached npm inherits /dev/tty #200244 note), and regression tests pin the piped, no-terminal, and --json paths.

User Impact

  • Success criteria: curl … | bash -s -- --onboard now drops the user into onboarding after the install and exits 0; headless runs get No terminal available; run …/bin/openclaw onboard to finish setup. on stderr plus an onboarding skip NDJSON event, and still exit 0.
  • What should reviewers focus on? scripts/install-cli.sh (terminal handoff at the end of main()) and test/scripts/install-cli.test.ts ("runs onboarding with stdin from the controlling terminal, not the installer pipe", "defers onboarding without a terminal and keeps exit status and JSON output clean", "keeps onboarding output out of the JSON event stream when a terminal exists").

Evidence

The maintainer correction preserves interactive stdin/stdout even in a session without a controlling terminal. When install output is redirected, the wizard receives both descriptors from the terminal. Its prompts stay out of redirected logs and JSON output. Linux CI passed the real-PTY cases for redirected output, JSON, and inherited descriptors, plus the no-terminal deferral. The final terminal handoff opens the terminal once for reading and writing. The installer workflow passed, including ShellCheck on the assembled script. The PTY tests use a CLI fixture that enforces the wizard’s terminal requirement. The packaged-wizard run below is the contributor’s earlier Linux proof.

  • Real environment tested: Linux (EL8) at rebased head 245241f3194 (on main fd3e1dc0b16). Real end-to-end product runs — no installer function stubbed: the standalone distribution script (install-cli.sh with install-policy.sh inlined, the exact artifact shape openclaw.ai/install-cli.sh serves) was fed to bash through a pipe (cat install-cli.sh | bash -s -- …), run inside a real PTY (util-linux script, stty cols 120 rows 36) and under setsid without a controlling terminal. Node 24.22.1 was downloaded from nodejs.org (sha256 verified) and the real openclaw npm package was installed from the registry over the network, in isolated HOME/prefix directories.
  • Exact steps or commands run after this patch:
    # format + lint + same-directory tests + tsgo:core (rebased head)
    bash skills/fix-pr/scripts/validate.sh scripts/install-cli.sh test/scripts/install-cli.test.ts   # all pass (99 tests)
    # installer test surface incl. upstream's new #202312/#202385 tests after the rebase
    node scripts/run-vitest.mjs run test/scripts/install-cli.test.ts test/scripts/install-cli.freebsd.test.ts \
      test/scripts/install-sh.test.ts test/scripts/standalone-installers.test.ts \
      test/scripts/website-installer-sync-workflow.test.ts test/scripts/install-smoke-candidate-payload.test.ts
    # -> 389 passed | 2 skipped
    bash -n scripts/install-cli.sh scripts/install.sh   # syntax OK
  • Evidence after fix: (real piped installer, real network install, real onboarding)
    === run-base: current main fd3e1dc0b16, fresh real install 2026.11.5, PTY, plain --onboard ===
    install OK ("added 361 packages in 1m", OpenClaw 2026.11.5 (e13cf15))
    final `openclaw onboard` step: "Onboarding needs an interactive TTY. Use `openclaw
    onboard --non-interactive --accept-risk ...` for automation."   -> installer EXIT 1
    
    === run-a: this patch, fresh real install 2026.11.5, PTY, plain --onboard ===
    install OK (Node 24.22.1 from nodejs.org, [email protected] from npm)
    real wizard opened on the controlling terminal and answered live:
    "How would you like to start?" -> Quick start; "What would you like to create?"
    -> One agent; "Model/auth provider" -> Skip for now; "Everything's in place."
    -> installer EXIT 0; real state written under $HOME/.openclaw
    
    === run-b: this patch, latest-stable upgrade to 2026.11.6, PTY, --json --onboard,
              installer stdout redirected to a file (automation consumer) ===
    upgrade OK ("changed 373 packages in 42s", OpenClaw 2026.11.6 (06afb10))
    installer stdout = 6 lines, each an independent valid NDJSON record:
        {"event":"step","name":"node","status":"skip","path":"…/tools/node-v24.22.1"}
        {"event":"step","name":"git","status":"ok"}
        {"event":"step","name":"openclaw","status":"start","version":"latest"}
        {"event":"step","name":"openclaw","status":"ok","version":"latest"}
        {"event":"step","name":"gateway-service","status":"skip","reason":"not-loaded"}
        {"event":"done","ok":true,"version":"OpenClaw 2026.11.6 (06afb10)"}
    wizard ran again interactively on the terminal and completed cleanly — its output
    never touched the NDJSON stream -> installer EXIT 0
    
    === run-c: this patch, latest-stable upgrade re-run, setsid (no controlling terminal),
              --json --onboard ===
    stdout = same NDJSON stream plus, before done:
        {"event":"step","name":"onboarding","status":"skip","reason":"no-terminal"}
    stderr: No terminal available; run …/prefix/bin/openclaw onboard to finish setup.
    -> installer EXIT 0
    existing settings untouched: openclaw.json sha256 identical before/after run
    (691dddf750dc907dc8cc5ab0b9b917ce1327094f07f4d5e38614899e126a07a4)
    
  • Observed result after fix: the documented one-liner now enters interactive onboarding from the terminal and exits 0; headless installs defer onboarding with a visible hint and keep exit status 0; --json stdout parses line-by-line as independent NDJSON records in every path; a latest-stable upgrade preserves existing settings byte-for-byte.
  • Before evidence (optional, visual changes encouraged): the run-base block above is a full real-network reproduction against current main fd3e1dc0b16 (which already includes fix: show how to run openclaw when install-cli.sh leaves it off PATH #202312/fix(install): keep install-cli.sh --json stdout limited to NDJSON events #202385): install completes, the final openclaw onboard step inherits the curl pipe, the wizard refuses to start, and the installer exits 1.
  • What was not tested: the wizard was driven through its real prompts but exited via the "Skip for now" path — no provider credentials (API key/OAuth verification) were entered, and the gateway was not brought up; macOS-specific terminal-device resolution (/dev/pts/* comes from Linux ps -o tty=) was exercised on Linux only.
  • Proof tier: L3
  • Proof limitations: none
  • Review state: awaiting re-review after rebase onto main + real-install proof

@clawsweeper

clawsweeper Bot commented Nov 18, 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 scripts Repository scripts size: S labels Nov 18, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR gives installer-launched onboarding terminal input, keeps interactive output separate from JSON events, and visibly defers setup without a terminal.

Example: Run curl -fsSL https://openclaw.ai/install-cli.sh | bash -s -- --onboard from a terminal.

  • Before: Installation succeeds, but onboarding inherits pipe input, rejects it, and the installer exits 1.
  • After: Onboarding reads from the controlling terminal and the completed wizard lets the installer exit 0.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, focused repair with sufficient shipped-entry-point evidence and no findings; exact-head workflow execution remains an approval gate.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): At reviewed head 245241f, the supplied Linux transcript exercises the assembled installer through a pipe with real Node/npm installation and packaged onboarding: the wizard completes under a PTY, JSON events remain separate, and setsid runs defer setup successfully; upgrade/rerun evidence records preserved configuration, while macOS execution is explicitly unclaimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Users following the documented piped installer command complete installation but cannot enter onboarding and receive a failure exit.
Reason: The narrow change restores an explicit first-run contract without adding settings, weakening interactive safeguards, or changing installation ownership.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this PR fixes a current first-run installer defect, with sufficient real-install evidence and no actionable code findings; exact-head CI awaits workflow approval.

Priority: P0
Reviewed head: 245241f31945cd5497adde97052c52faefe812f9

Before merge

  • Await maintainer action - Approve workflow execution for head 245241f, including CI and Website Installer Sync, and require successful completion before merge.

Findings

None.

Agent review details

How this fits together

The standalone CLI installer provisions OpenClaw into a local prefix, then hands control to the existing onboarding command; terminal input and installer JSON events require separate streams.

flowchart TD
  A[Piped installer invocation] --> B[Provision Node and OpenClaw]
  B --> C[Resolve controlling terminal]
  C --> D[Interactive onboarding]
  C --> E[Visible deferred setup command]
  B --> F[Installer NDJSON events]
Loading

Technical review

Best possible solution:

Land the focused installer handoff after approved exact-head workflows pass, retaining the existing wizard guard and visible headless setup command.

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

The inherited-pipe call on current main directly contradicts onboarding's TTY requirement, and the contributor supplies a real base failure; this read-only review executed no target code.

Is this the best way to solve the issue?

The patch repairs the installer-owned stream handoff using the established sibling approach; each added test group protects a distinct input, headless, or output-stream failure.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Tests +119, Other +46. Total +165 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 119 0 +119
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 48 2 +46
Total 2 167 2 +165

Preflight source

Source 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 cluster

Relationship: same_root_cause
Canonical: #201388
Summary: This PR implements the open canonical report; merged stream and terminal-device fixes address adjacent behavior without replacing this repair.

Members:

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

Labels

Label changes:

No label changes.

Label justifications:

  • P0: The first-run UX override applies: the documented installation command fails before onboarding opens, leaving recovery dependent on another terminal command.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-18T20:08:09.282Z sha a0f9a14 :: needs real behavior proof before merge. :: none

Reviewed November 21, 2026, 4:56 AM ET / 09:56 UTC (Revision 2).

… install

The documented curl | bash form leaves the curl pipe as stdin, so the final
openclaw onboard step inherits it, refuses to start via its interactive TTY
guard, and the installer exits 1 after the install already succeeded. Run
onboarding with stdin from the controlling terminal device (the same handoff
install.sh uses), keep its interactive output off the JSON event stream, and
when no terminal exists defer onboarding with a visible setup command while
keeping exit status 0.

Fixes openclaw#201388
@LiuwqGit
LiuwqGit force-pushed the feat/issue-201388-install-cli-onboard-tty branch from a0f9a14 to 245241f Compare November 21, 2026 09:49
@LiuwqGit

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Nov 21, 2026
@vincentkoc vincentkoc self-assigned this Nov 27, 2026
@vincentkoc
vincentkoc merged commit 6ea3594 into openclaw:main Nov 27, 2026
114 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

tideclaw-bot pushed a commit that referenced this pull request Nov 28, 2026
… install (#201430)

* fix(install): piped install-cli.sh --onboard fails after a successful install

The documented curl | bash form leaves the curl pipe as stdin, so the final
openclaw onboard step inherits it, refuses to start via its interactive TTY
guard, and the installer exits 1 after the install already succeeded. Run
onboarding with stdin from the controlling terminal device (the same handoff
install.sh uses), keep its interactive output off the JSON event stream, and
when no terminal exists defer onboarding with a visible setup command while
keeping exit status 0.

Fixes #201388

* fix(install): keep onboarding interactive when output is redirected

* fix(install): open the onboarding terminal once

Co-authored-by: LiuwqGit <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
(cherry picked from commit 6ea3594)
tideclaw-bot pushed a commit that referenced this pull request Nov 28, 2026
… install (#201430)

* fix(install): piped install-cli.sh --onboard fails after a successful install

The documented curl | bash form leaves the curl pipe as stdin, so the final
openclaw onboard step inherits it, refuses to start via its interactive TTY
guard, and the installer exits 1 after the install already succeeded. Run
onboarding with stdin from the controlling terminal device (the same handoff
install.sh uses), keep its interactive output off the JSON event stream, and
when no terminal exists defer onboarding with a visible setup command while
keeping exit status 0.

Fixes #201388

* fix(install): keep onboarding interactive when output is redirected

* fix(install): open the onboarding terminal once

Co-authored-by: LiuwqGit <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
(cherry picked from commit 6ea3594)
Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 28, 2026
… install (openclaw#201430)

* fix(install): piped install-cli.sh --onboard fails after a successful install

The documented curl | bash form leaves the curl pipe as stdin, so the final
openclaw onboard step inherits it, refuses to start via its interactive TTY
guard, and the installer exits 1 after the install already succeeded. Run
onboarding with stdin from the controlling terminal device (the same handoff
install.sh uses), keep its interactive output off the JSON event stream, and
when no terminal exists defer onboarding with a visible setup command while
keeping exit status 0.

Fixes openclaw#201388

* fix(install): keep onboarding interactive when output is redirected

* fix(install): open the onboarding terminal once

Co-authored-by: LiuwqGit <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: install-cli.sh --onboard fails under the documented curl | bash form (onboarding gets the pipe, not the TTY)

2 participants