Repository navigation
Description
Bug Report
Description
Problem Statement
The issue-2478-crash-loop-recovery nightly E2E job failed because the gateway recovery script in src/lib/agent/runtime.ts (both buildOpenClawRecoveryScript() and buildRecoveryScript()) only warns when /tmp/nemoclaw-proxy-env.sh is missing at recovery time but does not attempt to regenerate it from the preload scripts still on disk. Without proxy-env.sh, NODE_OPTIONS is empty, which means the safety-net and ciao-network-guard preload scripts are not loaded, and the E2E assertion checking for nemoclaw-sandbox-safety-net and nemoclaw-ciao-network-guard in NODE_OPTIONS fails:
FAIL: after recovery NODE_OPTIONS must contain sandbox-safety-net and ciao-network-guard (#2701)
This is the aarch64 crash-loop recovery path where the gateway process dies and the recovery script must bring it back with all security guards intact.
Proposed Design
Replace the warn-and-proceed branches in both buildOpenClawRecoveryScript() (line ~205) and buildRecoveryScript() (line ~279) in src/lib/agent/runtime.ts with regenerate-and-proceed logic that:
- Scans
/tmp/for known preload scripts (nemoclaw-sandbox-safety-net.js,nemoclaw-ciao-network-guard.js,nemoclaw-http-proxy-fix.js, etc.) - Reconstructs
NODE_OPTIONSfrom the--requiredirectives for each found script - Writes a fresh
/tmp/nemoclaw-proxy-env.sh, sources it, and logs the regeneration - Falls back to the original warn-and-proceed only if no preload scripts are found at all
- After regeneration, re-checks that the critical guards (safety-net and ciao-network-guard) are present in
NODE_OPTIONS
Alternatives Considered
- Persisting proxy-env.sh to a crash-safe location: Rejected because
/tmpis the documented ephemeral state directory for sandbox runtime, and adding persistence mechanics is out of scope. - Making the E2E test tolerate missing guards: Rejected because the guards are security-critical — the test correctly requires them.
Category
test_failure
Reproduction Steps
- Check out NemoClaw at commit
a3ae21b6eed8399099fd390bd45ad43e78218258 - Run the
issue-2478-crash-loop-recoveryE2E scenario, which triggers a gateway crash and recovery - Observe that after recovery,
NODE_OPTIONSis empty and the#2701assertion fails
Environment
- OS: GitHub Actions runner (Ubuntu 22.04, aarch64 emulation)
- Node.js: v22.16+
- Docker: Docker-in-Docker (GitHub Actions)
- NemoClaw: main @
a3ae21b - Other: Nightly E2E run 27386272836
Debug Output
N/A — CI job logs available at https://github.com/NVIDIA/NemoClaw/actions/runs/27386272836Logs
[gateway-recovery] WARNING: /tmp/nemoclaw-proxy-env.sh missing — proceeding without library guards
FAIL: after recovery NODE_OPTIONS must contain sandbox-safety-net and ciao-network-guard (#2701)Checklist
- I confirmed this bug is reproducible (required)
- I searched existing issues and this is not a duplicate (required)
Suggested Labels
nightly-e2e, auto-diagnosed, test-failure, agent-runtime, security
Suggested Labels (apply manually after triage)
nightly-e2e, auto-diagnosed, test-failure, agent-runtime, security
Related PR: #5259
Activity