timeout setting. When the timeout expires, the sandbox is stopped. By default, a new sandbox stays alive for 5 minutes.
Timeout vs. Idle timeout — don’t confuse them:
- Timeout is the maximum lifetime of the sandbox. It starts counting down from creation, regardless of activity, and always takes effect when it expires.
- Idle timeout only fires when no client is connected for the configured duration.
Create a sandbox with a timeout
Update the timeout
You can usesetTimeout / set_timeout to reset how much longer the sandbox should stay alive.
Lifecycle behavior
You can combinetimeout with lifecycle to choose whether the sandbox is killed or paused when the timeout expires.
lifecycle, the sandbox is killed when the timeout expires.