feat: extend the unbounded lifetime to container sandboxes - #2413
Merged
Conversation
Containers support timeout_minutes=-1 too, but the platform requires a finite lifetime as a safety fallback when a container sets an idle timeout; give those a 30-day lifetime, effectively unbounded. The agent-timeout cap now skips prime entirely. run() polls start/get_background_job directly instead of passing a sentinel deadline to run_background_job, which cannot wait forever. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
An idle timeout past 30 days would otherwise exceed the fallback lifetime and fail the SDK's idle <= lifetime validation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mikasenghaas
marked this pull request as ready for review
August 20, 2026 20:58
kcoopermiller
approved these changes
Aug 20, 2026
Contributor
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR makes significant changes to sandbox lifecycle management: extending container lifetimes from 24 hours to potentially unbounded, removing a safety validator, and switching to manual infinite polling for background jobs. These runtime behavior changes warrant careful review. You can add or adjust custom eligibility rules. Learn more. |
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
Follow-up to #2412, addressing review feedback that containers also support an unbounded lifetime.
timeout_minutes=-1— with one platform constraint: a container that sets an idle timeout must carry a finite lifetime as a safety fallback (422: container idle_timeout_minutes requires a finite timeout_minutes as a safety fallback). Those getIDLE_FALLBACK_LIFETIME(30 days, effectively unbounded; raised above the idle timeout when one exceeds it); containers without an idle timeout get a true-1.idle_timeout <= 24hvalidator and the 24hCONTAINER_LIFETIMEare gone.cap_remote_agent_timeoutskips Prime configs entirely; Modal keeps the 24h cap.run()pollsstart_background_job+get_background_jobdirectly instead of passing a sentinel deadline torun_background_job, which requires a finite timeout. The rollout's stage timeouts bound it via cancellation.Verification
Live against the API, through
PrimeRuntimefrom this branch (each ranecho hellothrough the newrun()poll, then deleted):timeout_minutes=43200(30d), exec exit 0timeout_minutes=-1, exec exit 0timeout_minutes=-1, exec exit 0🤖 Generated with Claude Code
Note
Extend unbounded lifetime to container sandboxes
CONTAINER_LIFETIMEwith a 30-dayIDLE_FALLBACK_LIFETIMEconstant in prime.pyPrimeRuntime.startrequeststimeout_minutes=-1for containers when no idle timeout is set, otherwise requests a finite lifetime that is the greater of 30 days or idle timeout plus 1 minute_validate_idle_timeoutvalidator that previously rejected idle timeouts exceeding the fixed lifetimecap_remote_agent_timeoutin compile.py skips the 24-hour cap for all Prime containers, not just VMsPrimeRuntime.runpolls background jobs manually without a client-side deadlineMacroscope summarized 4c99739.
Note
Medium Risk
Changes sandbox lifetime and job-wait behavior for Prime containers, so misconfigured idle timeouts or failed teardown can leave boxes running much longer. Not auth/security-critical, but it affects remote resource usage.
Overview
Prime container sandboxes can now live without a 24h hard cap, matching VMs. Creation uses
timeout_minutes=-1unless an idle timeout is set; the platform then requires a finite fallback, so those boxes get a 30-dayIDLE_FALLBACK_LIFETIME(raised above the idle timeout if needed).The container-only
idle_timeoutvalidator is gone.cap_remote_agent_timeoutskips all Prime configs, not just VMs (Modal still caps at 24h).PrimeRuntime.runpollsstart_background_job/get_background_jobinstead of the SDK helper that required a finite deadline; rollout stage timeouts still cancel the wait.Reviewed by Cursor Bugbot for commit 4c99739. Bugbot is set up for automated code reviews on this repo. Configure here.