Standby behavior
A sandbox can enter standby during a running command when:- No active connections remain
- No API requests poll the sandbox for updates
sandbox.process.exec with waitForCompletion: false. The process can enter standby before it finishes.
Wait for the process
Usesandbox.process.wait to maintain polling while a long-running process executes. Set a maximum wait duration appropriate for your workload and choose a polling interval that meets your latency requirements.
Poll from your backend
Use a backend service for polling instead of relying entirely on a browser. Backend polling continues if a user closes the browser and prevents the sandbox from entering standby during a critical process.Use an external agent
You can move the agent outside the sandbox and connect it to the sandbox through tools. This architecture can provide more direct lifecycle control, but it may be more complex depending on your use case and toolchain.Long-running processes
Wait for processes and configure keep-alive behavior.
Sandbox standby control
Understand connections and automatic standby.