Skip to content

docs(sandbox): clarify task process cleanup timing - #4614

Merged
ananthsub merged 2 commits into
NVIDIA-NeMo:mainfrom
yaoyu-33:codex/pr3902-nonblocking-docs
Oct 14, 2026
Merged

ananthsub merged 2 commits into
NVIDIA-NeMo:mainfrom
yaoyu-33:codex/pr3902-nonblocking-docs

Conversation

@yaoyu-33

Copy link
Copy Markdown
Contributor

Clarify the cleanup contract for task recipes and shared sandbox sessions, following the non-blocking approval notes on #3902 and the service-timing comment.

  • Explain that previously adopted children outside the harness group include unfinished background jobs such as make &, which can keep writing during verification. Describe the service-launch timing needed before a forced stop and the cleanup of newly orphaned children.
  • Correct sandboxed Hermes guidance: its adoption cutoff applies at the harness timeout, not on close, because the runner never signals the supervisor (a stop file only fences delayed launches).
  • Qualify SandboxSession's service-lifetime docstring, including the natural-exit limitation.
  • Correct the drain timing: in-flight tools are killed during the drain after the grace period, adoption follows the launching process's exit, and descendants of a preserved process also survive.

The associated #3902 description correction scopes the evidence: Pi/Codex/OpenCode certificate runs exercise deadline drain under a real model; preservation of services already adopted before a forced stop is covered only by Linux regressions. Synthetic service controls exercise normal completion.

No separate issue is needed for these small corrections to the existing review. Runtime behavior, configuration and benchmark scoring are unchanged.

Validation: pre-commit run --from-ref origin/main --to-ref HEAD and git diff --check pass. A Python AST comparison confirms sandbox_session.py has identical executable code to main after stripping docstrings. process_supervisor.py, supervisor_client.py and hermes_sandboxed_agent/app.py are unchanged on main since the reviewed #3902 head (30b121d4b), so the documented behavior still matches the code. Runtime tests and fresh model smoke: N/A for prose-only changes.

Supersedes #4604, which closed automatically when #3902 merged and its pull-request/3902 CI mirror base was deleted. This branch is rebased onto main (after the #3902 squash merge, 8bd25f3), so the diff contains only these three files.

🤖 Generated with Claude Code

yaoyu-33 and others added 2 commits October 14, 2026 12:54
The Hermes sandboxed runner never signals its supervisor, which is why it
requests no cleanup on close; a stop file only fences delayed launches.

In-flight tools are killed during the drain after the grace period, so a
service they parent is adopted and drained then. Adoption follows the
launching process's exit, and descendants of a preserved process also
survive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33 yaoyu-33 added docs Documentation-only updates or documentation debt area:sandbox Sandbox providers, isolation, and sandbox runtime contracts labels Oct 14, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yaoyu-33
yaoyu-33 marked this pull request as ready for review October 14, 2026 21:12
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 8770226

@nemo-automation-bot
nemo-automation-bot Bot requested review from a team October 14, 2026 21:12
yaoyu-33 added a commit to yaoyu-33/Gym that referenced this pull request Oct 14, 2026
Cross-checking the Stirrup sandbox adapter in NVIDIA-NeMo#4178 against this guide
found gaps the guide did not state:

- Return 4xx for deterministic seed and request errors, since the
  Environment Server retries 5xx and re-seeds the sandbox.
- Size the episode timeout to cover seed, install, run, close and
  verification, and use admission to queue before the deadline starts.
- Handle SIGTERM in the sandbox runner and write partial output.
- Serialize non-string grant tool results instead of validating them as
  arguments.
- Constrain transitive dependencies of in-sandbox installs and document
  package-index egress.
- Keep direct_http session cookies, which reach non-tool routes, out of
  files the model can read.

Also align the termination section with NVIDIA-NeMo#4614: preserved children include
unfinished background jobs, services must be adopted before the stop, and
descendants of a preserved process are not drained.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@ananthsub
ananthsub added this pull request to the merge queue Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/38653346189

@yaoyu-33 yaoyu-33 added complexity:low Localized change in one scope with a small, straightforward review surface ready-to-merge PR is approved, current, and waiting for final CI or merge labels Oct 14, 2026
Merged via the queue into NVIDIA-NeMo:main with commit 8260ca6 Oct 14, 2026
51 of 56 checks passed

This branch was previously deployed

1 inactive deployment
public — 8770226f Deployed Oct 14, 2026 by copy-pr-bot[bot] via release / finalize / notify #5383
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:sandbox Sandbox providers, isolation, and sandbox runtime contracts complexity:low Localized change in one scope with a small, straightforward review surface docs Documentation-only updates or documentation debt ready-to-merge PR is approved, current, and waiting for final CI or merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants