Metrics
Timeout
Set a timeout at create time or update it while the machine is running. Each client below is an equivalent alternative for the same setting. Note that the SDKs and CLI take a relative duration (seconds) while the HTTP API takestimeout_ms.
set_timeout is a refresh: each call resets the deadline to the new window from
now. The endpoint echoes the effective lease back so you can schedule the next
refresh without guessing:
timeout_ms— the window now in effecttimeout_at— the absolute deadline (RFC 3339)remaining_ms— milliseconds left untiltimeout_at, clamped at 0timeout_action— what fires at the deadline
set_timeout / setTimeout return this lease, and the same
timeout_at / remaining_ms appear on MachineInfo (from get/list):
on_timeoutis create-time lifecycle policy. Use"destroy"or"pause".timeout_actionis used byset_timeout(). Use"destroy"or"hibernate".
on_timeout="pause" at create time when persistence-capable deployments should
hibernate the machine instead. The TypeScript SDK does not expose autoResume
or a pause timeout policy on create, so configure pause-on-timeout with
auto-resume from the Python SDK, CLI, or HTTP API:
auto_resume=True is valid only with pause/hibernate timeout behavior. Updating
an auto-resumable machine to destroy-on-timeout is rejected so paused alias
routing cannot become inconsistent.
Keepalive while in use
When an agent loop needs to hold a machine open for as long as work is running, use the opt-in keepalive helper instead of hand-rolling a refresh loop. It refreshes the lease immediately, then on an interval (default: half the timeout window), and stops cleanly when the block exits.set_timeout; the server
contract stays an explicit refresh. Pass refresh_every_secs /
refreshEverySecs to control the cadence.