Skip to content

Allow sandboxes to pass optional entrypoint args and env#188

Open
CKwin26 wants to merge 3 commits intoaiming-lab:mainfrom
CKwin26:codex/sandbox-entrypoint-args-env
Open

Allow sandboxes to pass optional entrypoint args and env#188
CKwin26 wants to merge 3 commits intoaiming-lab:mainfrom
CKwin26:codex/sandbox-entrypoint-args-env

Conversation

@CKwin26
Copy link
Copy Markdown

@CKwin26 CKwin26 commented Mar 31, 2026

Summary

  • add optional args and env_overrides plumbing to sandbox run_project(...) backends
  • forward extra entrypoint arguments through local, Docker, and SSH execution paths
  • update the Docker entrypoint wrapper so entrypoint arguments are preserved instead of dropped
  • add small regression tests covering local sandbox execution plus Docker/SSH command construction

Why

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.py execution 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

  • extend SandboxProtocol.run_project(...) to accept optional args and env_overrides
  • teach ExperimentSandbox to append args to the Python command and merge env overrides into the subprocess environment
  • teach DockerSandbox to forward extra args after the entry point and inject -e KEY=value env overrides
  • teach SshRemoteSandbox to propagate entry args and env assignments in both bare and Docker-backed execution paths
  • make the Docker entrypoint script preserve and forward extra arguments after the entry point
  • keep ColabDriveSandbox API-compatible by accepting the new parameters even though the current worker protocol does not yet consume them

Validation

  • python -m compileall researchclaw/experiment/sandbox.py researchclaw/experiment/docker_sandbox.py researchclaw/experiment/ssh_sandbox.py researchclaw/experiment/colab_sandbox.py
  • bash -n researchclaw/docker/entrypoint.sh
  • python -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.

@CKwin26 CKwin26 closed this Mar 31, 2026
@CKwin26 CKwin26 deleted the codex/sandbox-entrypoint-args-env branch March 31, 2026 05:52
@CKwin26 CKwin26 restored the codex/sandbox-entrypoint-args-env branch March 31, 2026 05:56
@CKwin26 CKwin26 reopened this Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant