Skip to content

Reattach curl installer onboarding to tty - #377

Merged
kjw3 merged 4 commits into
mainfrom
fix/curl-install-tty
Mar 19, 2026
Merged

kjw3 merged 4 commits into
mainfrom
fix/curl-install-tty

Conversation

@kjw3

@kjw3 kjw3 commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • reattach interactive onboarding to /dev/tty when the installer is run from piped stdin
  • preserve existing behavior for direct interactive and non-interactive installs
  • fail clearly if interactive onboarding is requested without any TTY available

Fixes #376.

Testing

  • bash -n install.sh

Summary by CodeRabbit

  • Bug Fixes

    • Onboarding now correctly detects interactive terminals, handles piped input by attaching to an available terminal when possible, and respects explicit non-interactive mode.
    • Clearer error messaging when onboarding cannot run in the current environment, instructing users to retry in a terminal or enable non-interactive mode.
  • Tests

    • Installer preflight tests updated to exercise non-interactive invocations by setting the non-interactive environment flag.

@coderabbitai

coderabbitai Bot commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1dd87cd7-03ac-4159-9193-e090aa7564d0

📥 Commits

Reviewing files that changed from the base of the PR and between 9d9fa44 and 85ed109.

📒 Files selected for processing (1)
  • test/install-preflight.test.js
✅ Files skipped from review due to trivial changes (1)
  • test/install-preflight.test.js

📝 Walkthrough

Walkthrough

Installer onboarding now distinguishes explicit non-interactive mode, interactive when stdin is a TTY, and piped stdin where it reattaches onboarding to /dev/tty or fails with a clear error. Tests set NEMOCLAW_NON_INTERACTIVE=1 for several preflight scenarios.

Changes

Cohort / File(s) Summary
Installer TTY handling
install.sh
Modified run_onboard() to: use nemoclaw onboard --non-interactive when NON_INTERACTIVE=1; run interactive nemoclaw onboard only if stdin is a TTY; if stdin is piped but /dev/tty can be opened, run nemoclaw onboard attached to /dev/tty via fd and return its exit status; otherwise print an explicit error instructing re-run in a terminal or set NEMOCLAW_NON_INTERACTIVE=1.
Preflight test env
test/install-preflight.test.js
Added NEMOCLAW_NON_INTERACTIVE: "1" to environment passed to spawnSync for multiple installer preflight tests so they run non-interactively.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant User as User Terminal
    participant Curl as curl (pipe)
    participant Installer as install.sh
    participant TTY as /dev/tty
    participant Nemo as nemoclaw CLI

    User->>Curl: curl ... | bash (piped stdin)
    Curl->>Installer: start (stdin = pipe)
    alt NEMOCLAW_NON_INTERACTIVE=1
        Installer->>Nemo: nemoclaw onboard --non-interactive
    else stdin is a TTY (-t 0)
        Installer->>Nemo: nemoclaw onboard (stdin -> terminal)
    else /dev/tty readable
        Installer->>TTY: open /dev/tty (fd)
        Installer->>Nemo: nemoclaw onboard <&3 (attached to /dev/tty)
    else
        Installer->>User: print error -> "re-run in a terminal or set NEMOCLAW_NON_INTERACTIVE=1"
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nudged the pipe and found the key,
A tty peeks out, and chats with me.
If piped away, I knock on /dev/tty,
If told to hush, I run non‑chatty.
Hooray — onboard, with carrot glee. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: reattaching the curl installer onboarding to the TTY when stdin is piped, which is the core problem addressed by the PR.
Linked Issues check ✅ Passed The PR addresses all coding requirements from issue #376: detects when stdin is not a TTY, reattaches onboarding to /dev/tty when available, preserves non-interactive behavior, and fails clearly when no TTY is available.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the piped stdin onboarding issue. The install.sh modifications implement the TTY detection and reattachment logic, and test changes set NEMOCLAW_NON_INTERACTIVE for installer preflight scenarios as expected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/curl-install-tty
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@install.sh`:
- Around line 283-287: Replace the permission test [ -r /dev/tty ] with an
actual open attempt: try to open /dev/tty for reading into a new FD (e.g., exec
3</dev/tty), and if that succeeds run the existing onboarding command using that
FD (nemoclaw onboard redirected from FD 3, e.g., <&3) and then close the FD; if
the open fails, fall through to the existing error branch. Reference the
existing invocation nemoclaw onboard and /dev/tty and ensure you close the
temporary FD after use.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a4d06a5e-a3ab-4c9c-82b7-1a003c70030f

📥 Commits

Reviewing files that changed from the base of the PR and between 9513eca and a1a08b4.

📒 Files selected for processing (1)
  • install.sh

Comment thread install.sh Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/install-preflight.test.js (1)

343-354: ⚠️ Potential issue | 🟡 Minor

Missing NEMOCLAW_NON_INTERACTIVE flag may cause test failures.

This test passes the installer script via input: (line 346), meaning stdin is piped rather than a TTY. With the new TTY reattachment logic in run_onboard(), the installer will detect that stdin is not a TTY and either attempt to redirect from /dev/tty or fail with "Interactive install requires a TTY".

In CI environments where /dev/tty is unavailable, this test may fail or behave inconsistently. Consider adding NEMOCLAW_NON_INTERACTIVE: "1" to the env for consistency with the other modified tests, or verify that this test intentionally exercises the TTY reattachment path.

Proposed fix
       env: {
         ...process.env,
         HOME: tmp,
         PATH: `${fakeBin}:${TEST_SYSTEM_PATH}`,
+        NEMOCLAW_NON_INTERACTIVE: "1",
         NPM_PREFIX: prefix,
       },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/install-preflight.test.js` around lines 343 - 354, The test invokes the
installer script via stdin (reading CURL_PIPE_INSTALLER into spawnSync input)
but doesn't set NEMOCLAW_NON_INTERACTIVE, so run_onboard() may try to reattach a
TTY and fail; update the spawnSync env object to include
NEMOCLAW_NON_INTERACTIVE: "1" (alongside HOME, PATH, NPM_PREFIX) so the
installer runs in non-interactive mode for this test, or alternatively adjust
the test to intentionally exercise the TTY reattachment path if that behavior is
desired.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@test/install-preflight.test.js`:
- Around line 343-354: The test invokes the installer script via stdin (reading
CURL_PIPE_INSTALLER into spawnSync input) but doesn't set
NEMOCLAW_NON_INTERACTIVE, so run_onboard() may try to reattach a TTY and fail;
update the spawnSync env object to include NEMOCLAW_NON_INTERACTIVE: "1"
(alongside HOME, PATH, NPM_PREFIX) so the installer runs in non-interactive mode
for this test, or alternatively adjust the test to intentionally exercise the
TTY reattachment path if that behavior is desired.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5462870c-5931-4faa-a961-0b8c03c1246b

📥 Commits

Reviewing files that changed from the base of the PR and between a1a08b4 and a72e8f4.

📒 Files selected for processing (1)
  • test/install-preflight.test.js

@kjw3
kjw3 merged commit f3430c6 into main Mar 19, 2026
3 checks passed
@kjw3
kjw3 deleted the fix/curl-install-tty branch March 19, 2026 02:24
Ryuketsukami pushed a commit to Ryuketsukami/NemoClaw that referenced this pull request Mar 24, 2026
* reattach curl installer onboarding to tty

* update installer tests for non-interactive tty guard

* open tty explicitly for piped onboarding

* run stdin installer test in non-interactive mode
jessesanford pushed a commit to jessesanford/NemoClaw that referenced this pull request Mar 24, 2026
* reattach curl installer onboarding to tty

* update installer tests for non-interactive tty guard

* open tty explicitly for piped onboarding

* run stdin installer test in non-interactive mode
mafueee pushed a commit to mafueee/NemoClaw that referenced this pull request Mar 28, 2026
@wscurran wscurran mentioned this pull request Apr 13, 2026
@wscurran wscurran added area: install Install, setup, prerequisites, or uninstall flow area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression labels Aug 1, 2026
zeekay pushed a commit to Dream-AI-4444/NemoClaw that referenced this pull request Sep 9, 2026
* reattach curl installer onboarding to tty

* update installer tests for non-interactive tty guard

* open tty explicitly for piped onboarding

* run stdin installer test in non-interactive mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: install Install, setup, prerequisites, or uninstall flow area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

curl installer loses TTY for interactive onboarding

3 participants