Allow sandboxes to pass optional entrypoint args and env#188
Open
CKwin26 wants to merge 3 commits intoaiming-lab:mainfrom
Open
Allow sandboxes to pass optional entrypoint args and env#188CKwin26 wants to merge 3 commits intoaiming-lab:mainfrom
CKwin26 wants to merge 3 commits intoaiming-lab:mainfrom
Conversation
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.
Summary
argsandenv_overridesplumbing to sandboxrun_project(...)backendsWhy
Some experiment entrypoints need optional runtime parameters or environment overrides to select assets, caches, or execution-time behavior. The sandbox layer previously hard-coded
python main.pyexecution with no clean way to pass extra args or env overrides, which made these cases difficult to support without backend-specific hacks.This change keeps default behavior unchanged while allowing pipeline callers to pass optional entrypoint arguments and env overrides when needed.
Changes
SandboxProtocol.run_project(...)to accept optionalargsandenv_overridesExperimentSandboxto append args to the Python command and merge env overrides into the subprocess environmentDockerSandboxto forward extra args after the entry point and inject-e KEY=valueenv overridesSshRemoteSandboxto propagate entry args and env assignments in both bare and Docker-backed execution pathsColabDriveSandboxAPI-compatible by accepting the new parameters even though the current worker protocol does not yet consume themValidation
python -m compileall researchclaw/experiment/sandbox.py researchclaw/experiment/docker_sandbox.py researchclaw/experiment/ssh_sandbox.py researchclaw/experiment/colab_sandbox.pybash -n researchclaw/docker/entrypoint.shpython -m pytest -q tests/test_entry_point_validation.py -k "passes_args_and_env_overrides"python -m pytest -q tests/test_rc_docker_sandbox.py -k "forwards_entry_args_and_env"python -m pytest -q tests/test_ssh_and_colab_sandbox.py -k "forwards_args_and_env"Notes
A few broader Windows-side baseline tests in the repo currently fail for unrelated reasons (for example absolute-path validation expectations and symlink privileges). This PR only relies on the targeted checks above.