Skip to content

fix(ci): revert #2186 and use direct symlink for nemoclaw CLI on Brev#2195

Closed
cjagwani wants to merge 2 commits intomainfrom
revert/2186-brev-npm-link-launchable
Closed

fix(ci): revert #2186 and use direct symlink for nemoclaw CLI on Brev#2195
cjagwani wants to merge 2 commits intomainfrom
revert/2186-brev-npm-link-launchable

Conversation

@cjagwani
Copy link
Copy Markdown
Contributor

@cjagwani cjagwani commented Apr 21, 2026

Summary

Reverts #2186 (which made Brev E2E failures 10× slower) and replaces `sudo npm link` with a direct `sudo ln -sf` symlink in both the launchable setup and the in-test bootstrap path. `npm link` is overkill for what we actually need and hangs indefinitely on cold CPU Brev instances. Direct symlink is O(1) and deterministic.

Related Issue

Regression from my own #2186. Surfaced while validating #2183 (ollama E2E).

Changes

This PR contains two commits:

  1. Revert fix(ci): move sudo npm link into launchable to unblock non-full Brev E2E #2186. Restores the launchable setup to its pre-`sudo npm link` state. This alone would leave non-full suites broken by the original pre-existing chore(ci): extract helpers from brev-e2e beforeAll and fix worktree installer detection #1888 issue, but without burning a 20-min Brev instance per run.
  2. Replace `sudo npm link` with direct symlink.
    • `scripts/brev-launchable-ci-cpu.sh` — after plugin build, create `/usr/local/bin/nemoclaw → $NEMOCLAW_CLONE_DIR/bin/nemoclaw.js` via `sudo ln -sf`. Drop `sudo chown -R` (only the single symlink is root-owned now, not node_modules).
    • `test/e2e/brev-e2e.test.ts` — replace the in-test `sudo npm link` with the same direct-symlink approach. Idempotent re-link so local dev runs that skip the launchable still work.

Evidence

Type of Change

  • Code change (bug fix)

Verification

  • `bash -n` on the launchable script — syntax OK
  • `npm run typecheck:cli` — passes
  • Pre-push hooks — passes (modulo the pre-existing flaky `test/install-preflight.test.ts:107`, resolves on retry, unrelated)
  • End-to-end Brev E2E run — to be validated via `gh workflow run e2e-brev.yaml --ref revert/2186-brev-npm-link-launchable --field test_suite=credential-sanitization` (any non-`full` suite proves the bootstrap now completes). Will attach run URL before merge.

Retro note

Shipped #2186 without running the Brev suite end-to-end — exact failure mode I had flagged on #2123 earlier the same day. This PR is validated the right way before merge.

AI Disclosure

  • AI-assisted — tool: Claude Code

Summary by CodeRabbit

Chores

  • Optimized NemoClaw CLI installation mechanism with deterministic symlink approach, reducing environment setup initialization time.

cjagwani and others added 2 commits April 21, 2026 11:11
PR #2186 tried to unblock non-full Brev E2E suites by moving the slow
`sudo npm link` step from the test (120s cap) into the launchable
setup (20min outer cap). That hit a worse pathology: on cold CPU Brev,
`sudo npm link` + `sudo chown -R` on a ~50k-file node_modules tree
doesn't complete within 20 minutes at all. Every run now hangs at
"Linking nemoclaw CLI globally..." until the outer cap trips — 10×
longer to fail and 10× more Brev credit per failed run.

The previous commit reverts #2186. This commit replaces `sudo npm
link` with what npm link actually produces: two symlinks. We can do
them directly with `sudo ln -sf` and skip npm's global-prefix
housekeeping entirely. O(1), no chown traversal, no hang.

Changes:
  - scripts/brev-launchable-ci-cpu.sh: after plugin build, create
    /usr/local/bin/nemoclaw → $NEMOCLAW_CLONE_DIR/bin/nemoclaw.js with
    a direct `sudo ln -sf`. Drop the `sudo chown -R node_modules` that
    used to pair with npm link (no longer needed — only one file is
    owned by root now).
  - test/e2e/brev-e2e.test.ts: replace the in-test `sudo npm link` with
    the same direct-symlink approach. Launchable already pre-links on
    the same path; this is idempotent re-link so local dev runs that
    skip the launchable still work.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2615ed15-bbe1-4844-9628-da3fe5bb2a15

📥 Commits

Reviewing files that changed from the base of the PR and between 37ca70e and 2eb5274.

📒 Files selected for processing (2)
  • scripts/brev-launchable-ci-cpu.sh
  • test/e2e/brev-e2e.test.ts

📝 Walkthrough

Walkthrough

Updated the NemoClaw CLI installation process in a shell script and end-to-end test from using sudo npm link to creating direct filesystem symlinks via sudo ln -sf. Also adjusted SSH command timeout from 120,000 ms to 30,000 ms and updated corresponding log messages.

Changes

Cohort / File(s) Summary
NemoClaw CLI Installation Method
scripts/brev-launchable-ci-cpu.sh, test/e2e/brev-e2e.test.ts
Replaced sudo npm link installation with direct symlink creation (sudo ln -sf) and explicit executable permissions (sudo chmod +x). Reduced SSH command timeout from 120,000 ms to 30,000 ms in test file. Updated log messages to reference "direct symlink" and target path.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 No more npm link to unwind,
A symlink direct, so refined!
Permissions set with chmod's might,
The path to nemoclaw shines bright,
Swift thirty seconds, quick and tight! ✨

✨ 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 revert/2186-brev-npm-link-launchable

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

@cjagwani
Copy link
Copy Markdown
Contributor Author

Reopening with clearer branch name — see #NEW

@cjagwani cjagwani closed this Apr 21, 2026
@cjagwani cjagwani deleted the revert/2186-brev-npm-link-launchable branch April 21, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant