Repository navigation
feat: add sandbox expiry - #8
Conversation
| timeout_minutes: int = _json( | ||
| "timeout_minutes", omit_default=True, default=0 | ||
| ) | ||
| sigterm_before_expiry: bool = _json( | ||
| "sigterm_before_expiry", omit_default=True, default=False | ||
| ) |
There was a problem hiding this comment.
🟡 Misbound positional sandbox creation arguments
Existing positional calls to CreateSandboxRequest bind network lists and disk sizes to the new expiry fields. The SDK sends them under expiry keys instead of applying the requested network and disk settings.
Learn more
CreateSandboxRequest is a public dataclass, so its generated constructor accepts fields positionally in declaration order. Client.create_sandbox passes the request to the transport, which uses Model.to_dict to serialize the fields by name without checking their types.
Example: CreateSandboxRequest('', 's-4vcpu-4gb', 'devbox:1', 'demo', {}, [], 8192) used to send disk_mib: 8192 and omit the empty networks list. It now sends timeout_minutes: [] and sigterm_before_expiry: 8192 instead.
Recommended fix: Move both expiry fields after the existing request fields to preserve the public positional signature. Add a regression test that serializes a request using the old positional arguments.
Was this helpful? React with 👍 or 👎 to provide feedback.
| timeout_minutes: int = _json( | ||
| "timeout_minutes", omit_default=True, default=0 | ||
| ) |
There was a problem hiding this comment.
🔍 Undocumented zero timeout behavior
CreateSandboxRequest has no docstring explaining that zero omits the timeout rather than sending it for validation. The expiry guide lists only 2–1440 minutes.
Was this helpful? React with 👍 or 👎 to provide feedback.
| "expires_at": "2026-11-23T12:10:00Z", | ||
| "sigterm_before_expiry": True, |
There was a problem hiding this comment.
Uh oh!
There was an error while loading. Please reload this page.