Auto-Inactivity Timeout
Machine providers can shut down idle machines to save resources.
Configure the timeout
Providers that support it expose an INACTIVITY_TIMEOUT option. Built-in providers with this option are Apple, Docker, Kubernetes, Microsandbox, and Podman. Values use Go duration format, for example 10m or 1h. See Set provider options.
If the option is unset, a machine provider's own default applies. Devsy uses 20 minutes when the provider sets no default. Container providers have no default: with the option unset, no daemon runs and no timeout applies.
How it works
Non-machine providers such as Docker, Podman, Kubernetes, and Microsandbox start a daemon in the container that watches for activity. When the timeout passes with no activity, the daemon exits.
Machine providers run a Devsy daemon on the VM. It checks every workspace on the machine. A workspace blocks shutdown when its state is unavailable, it is busy, it is still within its inactivity deadline, its timeout is not a positive duration, or it is not configured for auto-stop (no agent.exec.shutdown command, or shutdownAction set to none). If no workspace blocks shutdown, the daemon picks the workspace with the latest idle deadline and runs its agent.exec.shutdown command.
See the agent guide for how providers implement this, and Machine diagnostics for debugging.
Shutdown action
Set shutdownAction in devcontainer.json. It is not a provider option. Its effect on the container timeout:
nonedisables the container timeout monitor.stopContaineris the default for workspaces without Compose.stopComposeis the default for Compose workspaces.