Forward `volumes` through `OpenSandboxBackend` to `Sandbox.create`

Merged
PY
9d ago
+63-6

OpenSandboxBackend.create() had no volumes argument, so harness users could not mount host directories into an OpenSandbox sandbox.

Changes:

  • Add keyword-only volumes to OpenSandboxBackend.create(), stored on the backend and forwarded to Sandbox.create (_backend.py). None serializes to no volumes key, so existing request bodies are unchanged.
  • Capture the create-body volumes key in the fake transport. The existing default test now also asserts no volumes key is sent, and the existing pass-through test (renamed test_creation_options_pass_through) pins the exact volumes wire body.
  • Document the option in docs/harness/opensandbox-sandbox.md and the package README, with the issue's case: a read-write PVC mounted at the working directory, so a later sandbox starts with the last one's files.

Tests: pytest tests/harness/opensandbox_sandbox/test_backend.py -k "creation_options_pass_through or creation_requests_the_network_policy" (4 passed), pytest tests/harness/test_docs_parity.py -k opensandbox (10 passed), pyright and ruff clean on the touched files, API compatibility check against v2.75.0 clean.

Closes #14278


Summary by cubic

OpenSandboxBackend now accepts a volumes argument and forwards it to Sandbox.create, so harness users can mount host directories, PVCs, or OSSFS buckets into new sandboxes.

New Features

  • volumes takes the SDK's Volume objects and passes them through unchanged; omitting it leaves the request body as before.
  • Volumes only apply at creation; attaching to a ref leaves its mounts untouched.
  • Documents the option with an example in the harness docs and package README.