feat: default prime runtime idle timeout to 1h#1949
Conversation
Add `idle_timeout_minutes` to PrimeConfig (default 60) and pass it through to CreateSandboxRequest so a leaked sandbox self-terminates well before its 24h max lifetime. Set to None to disable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ApprovabilityVerdict: Needs human review This PR changes the default runtime behavior by enabling a 1-hour idle timeout for sandboxes where none existed before. While well-implemented and properly validated, the default behavior change affects all existing users and warrants human review to confirm the intended impact on sandbox lifecycle. You can customize Macroscope's approvability policy. Learn more. |
Rename idle_timeout_minutes -> idle_timeout and take seconds (the unit used for time elsewhere in v1), converting to whole minutes for prime's SDK. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 71a69c0. Configure here.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A tools.runtime.idle_timeout above 24h (seconds) would convert to idle_timeout_minutes > timeout_minutes, which prime's API rejects at sandbox creation. Validate it at config time against a shared MAX_LIFETIME_MINUTES constant instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rename MAX_LIFETIME_MINUTES -> MAX_LIFETIME and express it in seconds to match the seconds-based config surface; convert to minutes at prime's API. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Summary
idle_timeouttoPrimeConfig(seconds, default3600= 1h) and thread it throughPrimeRuntime.startintoCreateSandboxRequest.timeout_minutes) instead of costing a full day.TimeoutConfig, task timeouts); it's converted to prime's whole-minute API instart(ceil'd, floored to the SDK's 1-minute minimum).idle_timeoutabove the 24h max sandbox lifetime at config time (via a sharedMAX_LIFETIME_MINUTESconstant), instead of letting it fail at sandbox creation when the derived minutes exceedtimeout_minutes.tools.runtime.idle_timeout = nullto disable, or to any positive number of seconds up to 24h to tune it.🤖 Generated with Claude Code
Note
Medium Risk
Changes default Prime sandbox lifecycle (idle self-delete after 1h), which can terminate long-idle evals unless tuned or disabled via
idle_timeout = null.Overview
Prime sandboxes now get a configurable idle timeout so leaked sandboxes are reclaimed after inactivity instead of running until the 24h max lifetime.
PrimeConfiggainsidle_timeoutin seconds (default 3600,Nonedisables). A validator rejects values above the sharedMAX_LIFETIME(24h) cap.PrimeRuntime.startmaps seconds to Prime’s whole-minute API (idle_timeout_minutes, ceil with a 1-minute floor) and usesMAX_LIFETIMEfortimeout_minutesinstead of an inline constant.Reviewed by Cursor Bugbot for commit 7f7c169. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Default prime runtime idle timeout to 1 hour
idle_timeoutfield toPrimeConfig(default 3600s) that is passed to sandbox creation asidle_timeout_minutes, causing sandboxes to self-delete after 60 minutes of inactivity by default.idle_timeoutdoes not exceed the 24hMAX_LIFETIMEconstant; setidle_timeout=Noneto disable idle timeout entirely.idle_timeoutis explicitly set toNone.Macroscope summarized 7f7c169.