Repository navigation
Reattach curl installer onboarding to tty - #377
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughInstaller 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 Changes
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 | 🟡 MinorMissing
NEMOCLAW_NON_INTERACTIVEflag 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 inrun_onboard(), the installer will detect that stdin is not a TTY and either attempt to redirect from/dev/ttyor fail with "Interactive install requires a TTY".In CI environments where
/dev/ttyis unavailable, this test may fail or behave inconsistently. Consider addingNEMOCLAW_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
📒 Files selected for processing (1)
test/install-preflight.test.js
* 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
* 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
Signed-off-by: John Myers <[email protected]> Co-authored-by: John Myers <[email protected]>
* 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
Summary
/dev/ttywhen the installer is run from piped stdinFixes #376.
Testing
bash -n install.shSummary by CodeRabbit
Bug Fixes
Tests