Repository navigation
Sync spec and add sandbox volume support - #36
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The test can fail on a healthy but slower sandbox because it performs filesystem operations without first polling for the sandbox to reach DEPLOYED, with a timeout and failure-state check.
1 open issue
What changed in this PR
Adds persistent volume support to the sandbox SDK and synchronizes the management API specification and generated clients. The PR remains dependent on deployment of the backend specification.
Changes:
- Adds synchronous and asynchronous volume management, sandbox mounts, and related test coverage.
- Makes image cleanup repeat until complete, with optional progress callbacks.
- Refreshes generated API models, updates Black and certifi, and corrects preview-token expiry in end-to-end tests.
| File | Description |
|---|---|
uv.lock |
Updates Black and certifi. |
tests/sandbox/test_volumes.py |
Tests volume operations, pagination, and errors. |
tests/sandbox/test_parity.py |
Extends API parity checks for volumes and cleanup. |
tests/sandbox/test_images.py |
Tests repeated cleanup and progress callbacks. |
tests/sandbox/test_e2e.py |
Adds volume lifecycle tests and adjusts preview-token expiry. |
tests/sandbox/test_client.py |
Tests mount serialization and response mapping. |
scripts/apigen/specs/management.json |
Synchronizes volume endpoints, cleanup fields, and other API changes. |
baseten/sandbox/_volumes.py |
Implements synchronous and asynchronous volume clients. |
baseten/sandbox/_info.py |
Adds volume mount types and conversions. |
baseten/sandbox/_images.py |
Adds cleanup looping and callbacks; renames library volume size. |
baseten/sandbox/_client.py |
Exposes volume clients and sandbox creation mounts. |
baseten/sandbox/__init__.py |
Exports volume and cleanup progress types. |
baseten/client/managementapi/_models.py |
Regenerates models from the updated specification. |
baseten/client/managementapi/_client.py |
Adds generated volume API methods. |
baseten/client/managementapi/__init__.py |
Exports newly generated models. |
Review effort: Balanced
wfortin
approved these changes
Oct 28, 2026
cploujoux
approved these changes
Oct 28, 2026
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.

🚀 What
Cannot merge until backend spec deployed
💻 How
VolumeClient/AsyncVolumeClientinbaseten/sandbox/_volumes.py, asclient.volumesSandboxVolumeMount, withvolumeson sandbox create andSandboxInfosizeisstr | int, same as filesystemmax_memory_usage;ImageLibraryVolume.size_mbrenamed tosizecleanupkeeps calling whilehas_moreis set and adds updeleted;progressruns between calls (can be async on the async client)🔬 Testing
test_volume_crud(async) andtest_volume_mount(sync) pass on staging