Repository navigation
fix: make ulimit best-effort, fix PATH test regression - #947
Conversation
…-line The ulimit hardening (ref #809) fatally exited when the container runtime (e.g., brev) rejected the limit modification with "Invalid argument", breaking sandbox bootstrap entirely. Make it best-effort: warn but continue. The PATH test previously used grep to extract the export line, which was a tautology that didn't test actual preamble behavior. Replace with a line-by-line eval loop that stops at the PATH export — no hardcoded line numbers, no grep, won't break when lines are added above PATH.
|
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 as they are similar to previous changes (1)
📝 WalkthroughWalkthroughReplaced fail-fast hard Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 `@test/e2e-gateway-isolation.sh`:
- Around line 128-129: The current approach uses eval on every line of
/usr/local/bin/nemoclaw-start inside run_as_root (the OUT capture) which
executes pre-PATH control statements and can abort the shell; instead, change
the OUT assignment to extract the export PATH= line without eval and then safely
expand only that RHS. Locate the OUT assignment (the run_as_root "bash -c 'while
IFS= read -r line; do eval ...'") and replace it with logic that greps/awk/sed
for the line beginning with "export PATH=" in /usr/local/bin/nemoclaw-start,
extracts the quoted/unquoted RHS, and echoes that value (or evaluates it in a
tightly-scoped subshell) to set OUT — avoid invoking eval on arbitrary lines or
sourcing the whole file.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: bce41f22-b7f3-4e30-ab65-504079c99cd5
📒 Files selected for processing (2)
scripts/nemoclaw-start.shtest/e2e-gateway-isolation.sh
The line-by-line eval approach broke because eval-ing `set -euo pipefail` activated -e, then the next partial `if` statement was a syntax error (exit 2) that killed the shell. Run a real command through the entrypoint instead — tests actual behavior, not script parsing.
This reverts commit 68a488a.
The line-by-line eval loop eval'd set -euo pipefail, then the partial multi-line if/fi ulimit block was a syntax error (exit 2) under -e. Only eval lines starting with "export" so control flow and shell options are skipped entirely.
|
Thanks for jumping on the The blocker is
I reproduced that directly on Mac against the PR branch content. What I think needs to change to merge:
A couple of safe directions:
Once the PATH test is rewritten so it is actually safe and reliable, I’d be happy to re-review. |
* fix: make ulimit best-effort and fix PATH test to walk script line-by-line The ulimit hardening (ref NVIDIA#809) fatally exited when the container runtime (e.g., brev) rejected the limit modification with "Invalid argument", breaking sandbox bootstrap entirely. Make it best-effort: warn but continue. The PATH test previously used grep to extract the export line, which was a tautology that didn't test actual preamble behavior. Replace with a line-by-line eval loop that stops at the PATH export — no hardcoded line numbers, no grep, won't break when lines are added above PATH. * fix: test PATH via real entrypoint instead of eval loop The line-by-line eval approach broke because eval-ing `set -euo pipefail` activated -e, then the next partial `if` statement was a syntax error (exit 2) that killed the shell. Run a real command through the entrypoint instead — tests actual behavior, not script parsing. * Revert "fix: test PATH via real entrypoint instead of eval loop" This reverts commit 68a488a. * fix(test): eval only export lines in PATH test to avoid set -e exit The line-by-line eval loop eval'd set -euo pipefail, then the partial multi-line if/fi ulimit block was a syntax error (exit 2) under -e. Only eval lines starting with "export" so control flow and shell options are skipped entirely.
Summary
ulimit -Hu/-Su 512fatally exited on container runtimes (e.g., brev) that reject limit modification with "Invalid argument", breaking sandbox bootstrap. Now warns and continues.while readloop that evals each line and stops atexport PATH=. No hardcoded line numbers, no grep, won't break when lines are added above PATH.Test plan
Summary by CodeRabbit
Refactor
Tests