Repository navigation
Add sandbox previews - #29
Merged
Merged
Conversation
cploujoux
approved these changes
Oct 16, 2026
There was a problem hiding this comment.
🟡 Changes recommended
The public authentication instructions use an unsupported query parameter, preventing private-preview access when followed.
1 open finding
What changed in this PR
Adds public and token-gated HTTPS previews for sandbox ports through the Python SDK.
Changes:
- Adds synchronous and asynchronous preview and token management.
- Regenerates management API clients and models.
- Adds unit, parity, and end-to-end coverage.
| File | Description |
|---|---|
| tests/sandbox/test_previews.py | Tests requests, mapping, pagination, and errors. |
| tests/sandbox/test_parity.py | Checks preview API and model parity. |
| tests/sandbox/test_e2e.py | Exercises preview access and lifecycle. |
| scripts/apigen/specs/management.json | Adds preview endpoints and schemas. |
| baseten/sandbox/_sandbox.py | Exposes sandbox preview managers. |
| baseten/sandbox/_previews.py | Implements preview and token management. |
| baseten/sandbox/_common.py | Adds management API access to sandbox contexts. |
| baseten/sandbox/_client.py | Passes management client and team context. |
| baseten/sandbox/__init__.py | Exports preview interfaces and types. |
| baseten/client/managementapi/_models.py | Adds generated preview models. |
| baseten/client/managementapi/_client.py | Adds generated preview operations. |
| baseten/client/managementapi/__init__.py | Exports generated preview models. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
💻 How
/v1/spec(adds preview ops)sandbox.previewsreturnsSandboxPreviews/AsyncSandboxPreviews:create,get_info,list,update,delete,create_token,list_tokens,delete_tokenSandboxPreviewInfo/SandboxPreviewTokenInfo; TTL astimedelta, like other durationsSandboxfromsandbox_from_url(no name)🔬 Testing
test_previewse2e on both clients against staging: private preview rejected without a token, served with one (response and request headers applied), revoked token rejected, switch to public, delete