Skip to content

feat: allow update_ttl and update_lifecycle to accept None to clear values (ENG-3189)#173

Merged
cploujoux merged 2 commits into
mainfrom
cploujoux/devin/allow-clear-ttl-lifecycle
Jun 18, 2026
Merged

feat: allow update_ttl and update_lifecycle to accept None to clear values (ENG-3189)#173
cploujoux merged 2 commits into
mainfrom
cploujoux/devin/allow-clear-ttl-lifecycle

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Allow SandboxInstance.update_ttl() and SandboxInstance.update_lifecycle() to clear existing values by accepting None.

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.

- async def update_ttl(cls, sandbox_name: str, ttl: str)
+ async def update_ttl(cls, sandbox_name: str, ttl: Optional[str])

When ttl is None or "", spec.runtime.ttl is set to None (serialized as JSON null).

- async def update_lifecycle(cls, sandbox_name: str, lifecycle: SandboxLifecycle)
+ async def update_lifecycle(cls, sandbox_name: str, lifecycle: Optional[SandboxLifecycle])

When lifecycle is None, spec.lifecycle is set to None in 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, and sdk-go.

Link to Devin session: https://app.devin.ai/sessions/9c34a09514f74a6a92006ade786b3885
Requested by: @cploujoux


Note

Allows update_ttl and update_lifecycle to accept None to 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.

- 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>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

mendral-app[bot]

This comment was marked as outdated.

@mendral-app

mendral-app Bot commented Jun 18, 2026

Copy link
Copy Markdown
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>

@mendral-app mendral-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@cploujoux cploujoux merged commit 3b27e0e into main Jun 18, 2026
16 of 21 checks passed
@cploujoux cploujoux deleted the cploujoux/devin/allow-clear-ttl-lifecycle branch June 18, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant