Repository navigation
feat: sync SDK to current API (proxies, instance sizing, renew) - #3
Merged
Merged
Conversation
czpython
force-pushed
the
feat/http-proxies
branch
3 times, most recently
from
July 9, 2026 07:22
e7c4fda to
8a87c8f
Compare
Bring the client up to the current Drukbox HTTP API:
- HTTP proxies: create/delete/attach/detach_http_proxy plus HTTPProxy and
HTTPProxyAttachment records
- Instance sizing: create_host(instance_type=, disk_gb=) and the matching
SandboxHost fields
- Lease renewal: renew_host() for POST /hosts/{id}/renew
- expires_at now mirrors the wire tri-state: omit for the default lease,
pass a datetime for an explicit expiry, pass None for a permanent host
Records are constructed inline (cls(**data)) — no parser-per-type layer,
no generic builder. New error paths reuse the existing status classifier,
so no new exception types.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
czpython
force-pushed
the
feat/http-proxies
branch
from
July 9, 2026 07:27
8a87c8f to
6d1f5fd
Compare
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
Brings the client up to the current Drukbox HTTP API. Three parts of the surface weren't covered yet.
HTTP proxies
create_http_proxy(*, name, target, headers)→HTTPProxydelete_http_proxy(name)attach_http_proxy(name, host_id)→HTTPProxyAttachmentdetach_http_proxy(name, host_id)HTTPProxy,HTTPProxyAttachmentInstance sizing
create_host(instance_type=..., disk_gb=...)SandboxHost.instance_type/.disk_gbLease renewal
renew_host(host_id, expires_at=...)→POST /hosts/{id}/renew, returns the updatedSandboxHostcreate_hostnow mirrors the wire tri-state forexpires_at: omit it for the default lease, pass a datetime for an explicit expiry, passNonefor a permanent (never-reaped) host. A private sentinel default distinguishes "omitted" from "passedNone" — a plaindatetime | Nonedefault can't.No new exceptions
Every new error path reuses status codes the
_requestclassifier already handles:SandboxConflictErrorSandboxNotFoundErrorexpires_atSandboxValidationErrorSandboxResponseErrorSandboxUnavailableErrorInternal cleanup
Removed the parser-per-type layer (previously five
_parse_*functions). Records are now constructed inline withcls(**data)— no helper, no generic. Dropped the "ignore unknown server fields" behavior: the SDK is co-versioned with the service, so an added field is handled by updating the SDK.Tests
Net new respx coverage: proxy happy paths + conflict/not-found/validation; sizing round-trip; permanent-host explicit-null; renew happy path, omit-body, 404, 409. Full suite 42 passed; ruff + pyright clean.