feat: default prime sandboxes to no lifetime timeout - #2412
Merged
Conversation
Prime supports unbounded sandbox lifetimes (timeout_minutes=-1), so the runtime no longer forces the previous 24h cap. A new PrimeConfig.timeout field (seconds, default None) sets a lifetime when one is wanted. No lifetime limit is only supported for VM sandboxes, so vm=false now requires an explicit timeout at config validation. The remote agent-timeout cap follows the configured lifetime for prime instead of assuming 24h. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
VM sandboxes get no lifetime limit, containers keep the fixed 24h cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mikasenghaas
marked this pull request as ready for review
August 20, 2026 18:24
xeophon
approved these changes
Aug 20, 2026
hallerite
approved these changes
Aug 20, 2026
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
timeout_minutes=-1(Prime's convention for an unbounded lifetime) instead of the previous 24h cap.vm=false) keep the fixed 24h lifetime (CONTAINER_LIFETIME) — only VM sandboxes support running without a limit.idle_timeout > 24his now rejected only for container sandboxes; VM sandboxes accept any idle timeout.cap_remote_agent_timeoutskips Prime VM configs (no lifetime to cap against); Prime containers and Modal keep the 24h cap.run()bounds the SDK's background-job poll at the container lifetime, or an effectively unbounded deadline for VMs.Verification
timeout_minutes=0is rejected (422: timeout_minutes must be negative for infinite or >= 1);timeout_minutes=-1creates a VM sandbox that reaches RUNNING and deletes cleanly.PrimeRuntimefrom this branch with the default config: sandbox came up RUNNING withtimeout_minutes=-1and was deleted onstop().vm=falsevalid (24h lifetime); containeridle_timeout > 24herrors; VM accepts any idle timeout; agent-timeout cap is a no-op for Prime VMs and caps containers at 24h.Breaking
idle_timeout(default 3600s) is now the only automatic cleanup for them; rely on it or delete explicitly.🤖 Generated with Claude Code
Note
Medium Risk
Changes remote sandbox lifetime and timeout capping. Failed teardown can leave VMs running indefinitely except for idle_timeout.
Overview
Prime VM sandboxes no longer get a 24h hard lifetime. Create now sends
timeout_minutes=-1(provider “no limit”); containers still use a fixed 24hCONTAINER_LIFETIME.Idle-timeout validation and
cap_remote_agent_timeoutonly enforce the 24h ceiling for non-VM remotes (Prime containers, Modal, etc.). VM agent timeouts are left uncapped.run()polls with a 365-day deadline for VMs so the SDK still has a finite wait.Breaking: VMs no longer self-delete after 24h. Cleanup is
idle_timeout(default 1h) or explicit delete.Reviewed by Cursor Bugbot for commit 69a7631. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Default Prime VM sandboxes to no lifetime timeout
timeout_minutes=-1(provider convention for no limit) and polled with a 365-day timeout, effectively removing the lifetime capCONTAINER_LIFETIME(renamed fromMAX_LIFETIME)PrimeConfig._validate_idle_timeoutskips the 24h upper-bound check for VM sandboxes; container sandboxes still enforce itcap_remote_agent_timeoutin compile.py now exemptsPrimeConfigwithvm=Truefrom the 24h agent-timeout cap and warningPrimeRuntime.runin prime.py andcap_remote_agent_timeoutin compile.py correctly gate which runtimes get the exemptionMacroscope summarized 69a7631.