feat: normalize the surface interface of Python SDK#73
Merged
christianalfoni merged 3 commits intomainfrom May 8, 2026
Merged
Conversation
christianalfoni
commented
May 8, 2026
Collaborator
Author
There was a problem hiding this comment.
Note! This file is deleted in the E2E tests PR, so can just ignore it
fertapric-togetherai
approved these changes
May 8, 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.
Normalize the Python SDK surface to flat keyword arguments
The Python SDK previously required users to import auto-generated request/body classes (
CreateSandboxBody,CreateExecRequest,ExecStdin,StartOptions,CreateSandboxParams) and pass them as a singlebodyorparamsargument. This branch flattens the public surface so calls read like idiomatic Python — no auto-generated types in user code, noStartOptions(...)wrappers — and folds in the new retry plumbing frommain.❌ Current behavior
✅ New behavior
🤔 Assumptions
CreateSandboxBody/CreateExecRequest/ExecStdin— they're internal wire types, not API ergonomics.update_execstatus today is"running", soupdate()is best modeled asresume()."{cols}x{rows}"for resize is what the agent expects (flagged in the docstring as not yet end-to-end verified).RetryConfig/RetryContext) introduced onmainshould be re-exported from the package root alongside the other public types.🧠 Decisions
"sandboxes.start","sandboxes.wait","sandboxes.create","execs.resume","execs.sendStdin","execs.resize") so users filtering onRetryContext.operationsee a consistent namespace.together_sandbox/_types.py(StartOptions,CreateSandboxParams) — the flat-kwargs signatures replace them entirely.🔄 Discussions
_call_api-based tests fail when mocks return bare model instances instead ofResponse[...]wrappers. Added themake_api_response/make_sandbox_responsehelpers to every patched mock and updated the error-path tests' regex matchers to the dotted op-name format._sandboxes.pyoriginally landed three camelCase op-names frommain. Renamed to dotted form during the merge so retry hooks see the same convention across the package.🧪 Testing
git grep '<<<<<<< \|=======$\|>>>>>>> 'returns nothing across the workspace.SandboxesNamespace.createbody construction (required-only + all optional kwargs),Execs.createflat-kwargs andenvdict wrapping,Execs.resumesendingRUNNING,Execs.send_stdinandExecs.resizebody shapes, plus error-path matchers for the new dotted op-names.pytest tests/ -vpasses locally.📁 References