Auto-Inactivity Timeout
Providers can stop idle workspaces to save resources. The workspace keeps its data when the provider preserves storage. Start it again with devsy workspace up.
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. If INACTIVITY_TIMEOUT is unset, Docker, Kubernetes, Podman, Apple, and Microsandbox containers never time out.
How it works
Non-machine providers such as Docker, Podman, Kubernetes, Apple, and Microsandbox start a daemon in the container that watches for activity. When the timeout passes with no activity, that daemon exits. For Microsandbox, Devsy also passes the timeout to the microsandbox CLI as --idle-timeout.
Apple provider
The Apple provider's option is documented to delete the container instead of stopping it. Files outside mounted volumes are lost when a container is deleted.
Machine providers run a Devsy daemon on the VM. When every workspace on the machine has been idle for the timeout, the daemon runs the agent.exec.shutdown command. That command is defined by the provider. State persists only if the provider keeps storage.
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.
nonedisables the container timeout monitor. For machines, it also preventsagent.exec.shutdownfrom running.- Any other value enables the container timeout monitor. For machines,
agent.exec.shutdownruns when the timeout passes, if the command is set.
When shutdownAction is unset, the default is stopCompose for Compose workspaces and stopContainer otherwise. The inactivity timeout path only checks whether the value is none; the page does not describe per-value container effects.