feat: allow update_ttl and update_lifecycle to accept None to clear values (ENG-3189)#173
Merged
Merged
Conversation
- update_ttl: accept Optional[str]; None or empty string sends null to server - update_lifecycle: accept Optional[SandboxLifecycle]; None sends null to server - Both async and sync variants updated Co-Authored-By: cploujoux <cploujoux@blaxel.ai>
Contributor
Author
🤖 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:
|
Contributor
|
✅ Linked to Linear issue ENG-3189 — status: In Review Note Posted by Linear Issue Enforcer · Tag @mendral-app with feedback. |
Co-Authored-By: cploujoux <cploujoux@blaxel.ai>
Contributor
There was a problem hiding this comment.
LGTM
The follow-up commit improves the TTL check from falsy coercion to an explicit None/empty-string test — a minor but correct refinement. No new correctness, security, or data-loss issues introduced.
Tag @mendral-app with feedback or questions. View session
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.
Summary
Allow
SandboxInstance.update_ttl()andSandboxInstance.update_lifecycle()to clear existing values by acceptingNone.Previously both methods required non-None values — there was no way to remove an existing TTL or lifecycle configuration through these helpers, even though the server supports it.
When
ttlisNoneor"",spec.runtime.ttlis set toNone(serialized as JSONnull).When
lifecycleisNone,spec.lifecycleis set toNonein the request body. Uses dict serialization to work around the generated model's truthiness checks on the lifecycle field.Both async (
sandbox/default/) and sync (sandbox/sync/) variants are updated.Part of a coordinated change across
sdk-typescript,sdk-python, andsdk-go.Link to Devin session: https://app.devin.ai/sessions/9c34a09514f74a6a92006ade786b3885
Requested by: @cploujoux
Note
Allows
update_ttlandupdate_lifecycleto acceptNoneto clear existing values. The follow-up commit replaces falsy coercion (ttl if ttl else None) with an explicit check (ttl is None or ttl == "") for more precise semantics.Written by Mendral for commit 9d5ab2c.