onStdout / on_stdout and onStderr / on_stderr callbacks. Output arrives as the command produces it, one line at a time, or in chunks when it comes fast.
Even while streaming, the returned
result still holds the complete stdout and stderr.AsyncSandbox takes the same callbacks with an awaitable run(). See the Sandbox reference.Idle timeout
The timer resets on every chunk, so a command that keeps producing output won’t triptimeoutMs no matter how long it runs. A command that goes completely silent still has to finish before the timeout.
Network drops
If the stream ends before thefinished event (a network hiccup, say), run() throws. Retry from the caller if you need the resilience. The command keeps running in the sandbox after your client disconnects, so you can reconnect with Sandbox.connect(id) if you saved the ID.