Skip to content

[MacOS] Gateway destroy kills sandbox session with Broken pipe instead of graceful error #992

Closed

Description

@zNeill

Description

Test Plan https://docs.google.com/document/d/14bIihtww1Jtzz9eU-FdmFixKRFO9WI_OuGw9yrEP9Cw/edit?pli=1&tab=t.0
4.4 - test case 4

When the OpenShell gateway is destroyed while a sandbox session is active, the sandbox connection is abruptly terminated with a Broken pipe error and exit code 255. The user receives no graceful error message indicating the gateway is restarting, and there is no automatic recovery once the gateway comes back. Active inference requests that were in-flight complete successfully, but subsequent requests and the sandbox session itself are killed without warning.

Steps to reproduce

  1. Complete nemoclaw setup successfully
  2. Set inference route: openshell inference set --provider ollama-local --model llama3.2:1b
  3. Connect to sandbox in Terminal 1: nemoclaw connect
  4. Start a looping inference request inside the sandbox:
    for i in $(seq 1 20); do
    echo  --- Request $i at $(date +%H:%M:%S) --- 
    curl -s -m 5 https://inference.local/v1/chat/completions \
    -H  Content-Type: application/json  \
    -d '{ model : llama3.2:1b , messages :[{ role : user , content : say hi }]}' \
    | head -c 120
    echo   
    sleep 2
    done
  5. In Terminal 2 (host), destroy and restart the gateway:
    export DOCKER_HOST= unix://$HOME/.colima/default/docker.sock 
    openshell gateway destroy -g nemoclaw && openshell gateway start --name nemoclaw
Actual Result
  • No graceful error message was shown inside the sandbox
  • No automatic recovery.

Steps to reproduce

No steps provided.


[NVB# 5982642]

[NVB#5982642]

Activity

  1. added
    NV QA
    on Mar 26, 2026
  2. added
    platform: macos
    and removed on Apr 1, 2026
  3. jyaunches commented on Apr 20, 2026

    @jyaunches
    Contributor

    Architectural Context — Active Session Detection

    Picking this up as part of a broader onboard.ts decomposition effort.

    The fix for this bug, done right, creates reusable infrastructure that improves destroy, rebuild, stop, status, list, connect, and uninstall. The core issue isn't just the Broken pipe UX — it's that no destructive operation in the CLI checks for active SSH sessions before proceeding.

    Proposed approach

    Create a shared sandbox-session-state.ts module with an getActiveSandboxSessions(sandboxName) utility that detects active SSH connections (via openshell forward list output and/or process detection). This module would be consumed by:

    Consumer File Behavior
    sandboxDestroy() nemoclaw.ts Warn: "⚠️ Active SSH session detected. Destroy anyway?"
    sandboxRebuild() nemoclaw.ts Same warning pattern
    cleanupGatewayAfterLastSandbox() nemoclaw.ts Check before automatic cleanup
    destroyGateway() onboard.ts Graceful disconnect before teardown
    stopAll() services.ts Warn about active sessions before stopping
    sandboxStatus() nemoclaw.ts Show "Connected: yes" in status output
    nemoclaw list nemoclaw.ts Show active indicator next to connected sandboxes
    sandboxConnect() nemoclaw.ts Warn "Already connected in another terminal"

    This earns its place in the refactoring plan not because the destroy function itself needs extraction from onboard.ts, but because the solution creates a new typed, testable shared module that addresses a cross-cutting concern across 9 call sites in 4 files — exactly the architectural pattern we're driving toward.

  4. self-assigned this
    on Apr 20, 2026
  5. changed the title [-][NemoClaw] [MacOS] Gateway destroy kills sandbox session with Broken pipe instead of graceful error[/-] [+][MacOS] Gateway destroy kills sandbox session with Broken pipe instead of graceful error[/+] on Apr 21, 2026
  6. PrachiShevate-nv commented on Apr 29, 2026

    @PrachiShevate-nv

    Verified this issue on Nemoclaw v0.0.30, this is now resolved. Closing the bughttps://nvbugspro.nvidia.com/bug/5982642

  7. added
    area: cli
    area: install
    area: onboarding
    and removed on Jun 3, 2026
  8. added theissue type on Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

NV QAarea: cliarea: installarea: onboardingplatform: macos

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions