fix(status): use -n flag for sandbox exec in checkMessagingBridgeHealth#2074
fix(status): use -n flag for sandbox exec in checkMessagingBridgeHealth#2074Sanjays2402 wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughReplaced positional sandbox name in Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Review rate limit: 9/10 reviews remaining, refill in 6 minutes. 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 `@src/nemoclaw.ts`:
- Around line 1075-1078: The readGatewayLog call uses positional sandbox name
which is inconsistent with the working spawnSync invocation at Line 1077; update
the argument array in the readGatewayLog (where spawnSync is invoked) to use the
same `["sandbox", "exec", "-n", sandboxName, "--", "sh", "-c", script]` shape
(and keep the same encoding/timeout/stdio options) so `sandbox exec` always
receives the `-n/--name` flag and avoids silent exit 127; locate the spawnSync
call inside readGatewayLog and replace the positional sandboxName entry with the
`-n` flag before the sandboxName.
🪄 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 Plus
Run ID: 6d87bdb6-1b80-4d84-a573-c39b1ea0e8ce
📒 Files selected for processing (1)
src/nemoclaw.ts
|
✨ Thanks for submitting this PR that proposes a fix for the openshell sandbox exec command to use the -n flag, which could help improve the reliability of the sandbox execution. Possibly related open issues: |
|
@Sanjays2402 can you add a DCO, please? |
openshell sandbox exec requires the -n/--name flag for the sandbox name. Without it, the sandbox name is interpreted as the command to execute, causing exit code 127. The catch block silently swallows this, so the Telegram 409 conflict warning is never shown in status output. Fixes NVIDIA#2018 Signed-off-by: Sanjays2402 <51058514+Sanjays2402@users.noreply.github.com>
Per CodeRabbit review on NVIDIA#2074: readGatewayLog used the same broken positional sandbox-name shape as the original checkMessagingBridgeHealth call, which silently fails with exit 127 and hides gateway log context. Switch it to the corrected form: ["sandbox", "exec", "-n", sandboxName, "--", "sh", "-c", ...]. Signed-off-by: Sanjays2402 <51058514+Sanjays2402@users.noreply.github.com>
f446836 to
f774bb1
Compare
|
Addressed both review items:
Force-pushed to |
|
Thanks @Sanjays2402 for digging into this and for the follow-up fix to apply the same argv shape to readGatewayLog. I resolved the remaining conflict locally against current main and found that the intended changes from this PR are already present there. Both checkMessagingBridgeHealth() and readGatewayLog() now use the correct openshell sandbox exec shape: -n -- sh -c .... This was superseded by the later log/audit work in #2590, merged as e225dfb, so once rebased this PR has no remaining diff to merge. Closing this as superseded to keep the queue clean. The linked issue #2018 is already closed; I added a note there asking folks to reopen it if the behavior regresses. |
Summary
checkMessagingBridgeHealth()callsopenshell sandbox exec <sandboxName> sh -c <script>with the sandbox name as a positional argument. However,openshell sandbox execrequires the-n/--nameflag. Without it, the sandbox name is interpreted as the command to execute, causing exit code 127. The catch block silently swallows this error, so the Telegram 409 conflict degraded warning is never shown innemoclaw <sandbox> statusoutput.Related Issue
Fixes #2018
Changes
src/nemoclaw.ts: changed["sandbox", "exec", sandboxName, "sh", "-c", script]to["sandbox", "exec", "-n", sandboxName, "--", "sh", "-c", script].Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Manually verified:
nemoclaw <sandbox> statusnow surfaces the Telegram 409 degraded warning instead of silently swallowing exit 127.AI Disclosure
Summary by CodeRabbit