fix(sandbox): pass declared environment to the initial process - #3392
Conversation
Apply the workload environment before stripping supervisor-only values and injecting provider placeholders in both canonical launch paths. The RFC 0012 bootstrap carries these values separately from inherited supervisor environment. Add child-process coverage for declared values, explicit HOME, stripped identity material, and provider precedence. Add a Docker-backed lifecycle regression for initial and exec environments in TTY and non-TTY modes. Validation: the child-process test fails without env application; the Docker regression fails with the pinned unpatched runtime and passes with the rebuilt runtime. Sandbox library tests: 201 passed, one ignored on Rust 1.95.0. mise run pre-commit passed. Full mise run ci is blocked by the host linker missing libz3. Fixes NVIDIA#3377. Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
All contributors have signed the DCO ✍️ ✅ |
|
I have read the DCO document and I hereby sign the DCO. |
|
/ok to test 4c5c661 |
|
Label |
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
This focused fix restores declared environment variables to the initial sandbox process while preserving supervisor-only stripping and provider-placeholder precedence in both canonical launch paths. The implementation, regression coverage, architecture note, and user documentation are consistent, and no blocking findings remain.
Blocking findings:
- No blocking findings remain
Carried findings:
- None
Non-blocking suggestions:
- None
Gator metadata
- Validation: Project-valid focused fix for linked regression #3377
- Docs: Relevant Fern sandbox documentation and architecture contract updated
- Checks: Branch Checks, Helm Lint, and Trivy Changes are green; required E2E is queued for the current head
- E2E:
test:e2eapplied; E2E Label Help requested rerun 35141913252, which is queued - Head SHA:
4c5c661f84930973c46b00f7e628ffe4934bc183 - Base SHA:
7c592196e74ce4e512e43af8cb4faa7b19473b96 - Merge base SHA:
2ccef97769e0e39c4dc06b4c3953d3735814f146 - Patch ID:
881708d22062297530fd947d58194b8a50eddb39 - Gator payload:
9 - Review mode:
initial - Previous reviewed SHA: none
- Review budget exhausted: no
- Maintainer decision required: no
- Next state:
gator:watch-pipeline
Monitoring CompleteMonitoring is complete because this PR has merged. Final status: Gator review found no blocking issues, the required checks including E2E passed, and maintainer approval was present before merge. I removed the active Gator metadata
|
Summary
Restore declared sandbox environment variables for the initial command. After the RFC 0012 runtime split, those values are carried separately from inherited supervisor environment, but canonical process launch never applies them; applications can therefore start without required configuration even when later exec sessions see it.
Related Issue
Fixes #3377.
Changes
apply_canonical_process_environment.HOME, supervisor-token removal, and provider-placeholder precedence.Testing
mise run pre-commitpasses.b3e4ad457sandbox runtime withdeclared_env=missingand passes against the rebuilt patched runtime in both modes.mise run cipasses on Linux ARM64 after installing the requiredlibz3-devdependency. The first run hit two WebSocket test failures inopenshell-supervisor-network; both passed in an isolated serial run, and an unchanged full CI rerun passed. No source changes were needed.The Docker comparison used the same
b3e4ad457gateway and supervisor, the same workload image from #3377, and a CLI built from this branch. Only the sandbox runtime image changed between failing and passing runs. Tests used an isolated temporary gateway and owned sandboxes; no images were published. This verifies environment propagation, not NemoClaw model inference.Checklist