feat: add update_network convenience method for sandbox network configuration#150
Conversation
…ates Add SandboxUpdateNetwork type and update_network class methods to both SandboxInstance (async) and SyncSandboxInstance (sync) following the existing update_metadata/update_ttl/update_lifecycle pattern. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
DevinAI add an integration test for this please |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Added integration tests in
See commit 7e75d13. |
|
DevinAI use httpbin |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Updated all integration tests to use |
|
DevinAI fix codeql |
…rnings Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Fixed the CodeQL "Incomplete URL substring sanitization" warnings by replacing |
There was a problem hiding this comment.
LGTM
The fix commit only changes test assertions from substring checks to exact set() equality — no logic changes. No new issues introduced.
Tag @mendral-app with feedback or questions. View session
Summary
Adds a high-level
update_networkclass method to bothSandboxInstance(async) andSyncSandboxInstance(sync) for updating sandbox network/proxy configuration without recreating the sandbox.Changes:
types.py: NewSandboxUpdateNetworktype acceptingSandboxNetworkor dictdefault/sandbox.py: Asyncupdate_networkclassmethod onSandboxInstancesync/sandbox.py: Syncupdate_networkclassmethod onSyncSandboxInstance__init__.py: ExportSandboxUpdateNetworkFollows the existing pattern of
update_metadata,update_ttl, andupdate_lifecycle.Review & Testing Checklist for Human
update_networkcorrectly calls the update API with the modified sandbox specawait SandboxInstance.update_network("my-sandbox", SandboxUpdateNetwork(network={"proxy": {...}}))network=Nonecorrectly sets the spec field toUNSETNotes
The backend already supports network updates via the sandbox update API — this PR adds the SDK convenience method.
Link to Devin session: https://app.devin.ai/sessions/9282779c78a94d22baf1c06d80566dc5
Requested by: @Joffref
Note
Adds
update_networkconvenience methods to bothSandboxInstance(async) andSyncSandboxInstance(sync) for updating sandbox network configuration in-place. Introduces aSandboxUpdateNetworkwrapper type and exports it from the package. The latest commit switches test assertions to exact set equality to resolve CodeQL URL substring warnings.Written by Mendral for commit 8ebdf03.