RLM: re-enable Sandboxes for both Python and Bash#776
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add sandbox backend for RLMEnv with tunnel routing, sandbox workers, and filesystem sync
This PR adds a sandbox execution backend to RLMEnv, enabling Python and bash REPLs to run inside Prime Sandboxes while keeping sub‑LLM calls and root tools local via a Prime Tunnel. It introduces sandbox lifecycle helpers, sandbox worker templates (no PTY/jail), deferred sandbox setup for envs that mutate the local staging FS before execution, and robust cleanup behavior. It also fixes bash root‑tool helper headers and ensures sandbox bash answers are captured correctly, plus syncs the sandbox filesystem back to local when retain_filesystem_after_rollout=True so reward functions can evaluate local state.
Type of Change
Testing
uv run pytestlocally.Checklist
Note
Enable sandbox execution for
RLMEnvexecution_backendoption (local|sandbox) withSandboxRLMExecutorhandling sandbox lifecycle, command exec, retries, and cleanup (viaSandboxExecutorMixin)bashandpython(no PTY/jail), with proper root‑tool invocation and state handling; deferred setup until first code execinterception_urlis provided); adds HTTP headers to root‑tool callsretain_filesystem_after_rollout=Truedocs/environments.md, experimental README) to describe sandbox mode and parameters; comprehensive tests added for backend selection, worker rendering, tunnel routing, cleanup, and FS provisioningWritten by Cursor Bugbot for commit 8b3304e. This will update automatically on new commits. Configure here.