feat: add support for per-sandbox idle timeout option#6
Merged
Conversation
Adds an optional idleTimeout param to Sandbox.create() that is forwarded to the backend only when set, letting the backend apply the cluster default when omitted. The resolved value is stored on the instance from the create/get response alongside maxLifetime. JSDoc documents the "whichever fires first" deletion model, the cluster-default inheritance, and the 10800 s cap. RUNNER-9437
Adds idleTimeout to the create() code example with inline comments explaining defaults and the 10800 s cap. Adds a new "Sandbox lifetime model" section describing the "whichever fires first" deletion semantics for maxLifetime and idleTimeout so callers understand how to keep a sandbox alive. RUNNER-9437
Aligns idleTimeout with maxLifetime by applying a client-side default of 900 s in the request body rather than omitting the field when unset. This makes the two parameters consistent and ensures callers always see explicit values echoed back. Updates JSDoc and README to reflect the concrete default instead of "inherits cluster value". RUNNER-9437
Reorders idleTimeout before maxLifetime consistently across the constructor, JSDoc params, request body, and create/get response objects so the new field appears first everywhere it was introduced. RUNNER-9437
Covers four cases: default values (900/3600) sent in the request body when neither is specified, explicit idleTimeout forwarded in the body, and idleTimeout stored on the instance from both the create and get API responses. All 88 tests pass. RUNNER-9437
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
FaaSt's SandboxHostname middleware rejects status/management requests that arrive at the generic apiHost instead of the per-sandbox HMAC-validated managementEndpoint. Added options.managementEndpoint to Sandbox.get() so callers can supply the value returned by create(); falls back to apiHost for dev environments without this routing. Also forward managementEndpoint from the GET response payload back onto the returned instance so subsequent destroy() calls use the correct host.
MichaelGoberling
left a comment
Collaborator
There was a problem hiding this comment.
Awesome to see this contribution 🙌
Comments for some user facing stuff
MichaelGoberling
approved these changes
Jun 10, 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.
Description
Add
idleTimeoutoption to sandbox-creation payload and updateREADME.mdto document sandbox lifetime model.Related Issue
Motivation and Context
The sandbox-creation API now support clients setting a per-sandbox idle timeout alongside the max lifetime option. This change exposes that capability to clients in the SDK.
How Has This Been Tested?
Local shell session running test script...
Screenshots (if appropriate):
N/A
Types of changes
Checklist: