Provider Agent
Devsy injects itself into an environment when it connects through a provider. That copy is the Devsy agent. It is the same binary, run as devsy agent. The agent deploys the container, forwards credentials, runs the SSH server, and stops idle environments.
The agent section of provider.yaml configures the agent.
agent:
path: ${DEVSY}
local: true
driver: docker
inactivityTimeout: 10m
containerInactivityTimeout: 10m
injectGitCredentials: ${INJECT_GIT_CREDENTIALS}
injectDockerCredentials: ${INJECT_DOCKER_CREDENTIALS}
binaries:
MY_BINARY:
- os: linux
arch: amd64
path: https://example.com/my-binary
checksum: <sha256 of the file>
exec:
shutdown: |-
${MY_BINARY} stopThis section can use option values.
- path: where the agent is placed on the remote machine.
- local: set to
truewhen Devsy runs on the same machine instead of a remote one. The built-in providers set it. - driver: how the container is deployed. One of
docker(default),kubernetes,apple,microsandbox,customorexternal. See Drivers. - inactivityTimeout: how long an idle machine runs before Devsy stops it. Machine providers only.
- containerInactivityTimeout: how long the container may stay idle before it stops. A Go duration such as
10m. Empty or0disables it. Non-machine providers only. - injectGitCredentials, injectDockerCredentials: whether to copy those credentials into the environment.
- exec.shutdown: the command that stops the machine once it is idle. Option values are available in it.
- binaries: helper binaries for
exec.shutdown. Same format as provider binaries.
Docker management policy
For the docker driver, the agent.docker section controls how Devsy manages Docker on the agent machine:
agent:
local: false
driver: docker
docker:
path: docker
install: false
configureDaemon: falseSet install: false when the provider supplies a Docker CLI. If that executable is missing, Devsy reports an error instead of installing Docker. An existing executable remains usable. With install unset or true, Devsy retains its existing installation behavior.
Set configureDaemon: false when the provider owns the Docker daemon, including a private daemon inside a VM. Devsy then does not read or modify the daemon configuration for its management step and does not reload the daemon. With configureDaemon unset or true, Devsy retains its existing behavior of configuring the daemon for a remote Docker agent. Local agents are not configured by this step. These settings accept provider option templates, which must resolve to valid boolean values before the agent starts Docker setup. This policy controls Devsy's daemon management, not arbitrary commands a user runs inside a devcontainer.
Stopping idle environments
Devsy tracks connections and stops the environment after the timeout. It starts the environment again when the user returns. State survives only if the provider keeps the storage. A shutdown command that deletes the machine must keep workspace data elsewhere, for example on a persistent volume.
Non-machine providers
Set the timeout with containerInactivityTimeout.
With the kubernetes driver, the Devsy daemon is the pod's main process. SSH sessions, hooks, and setup register with the daemon over a Unix socket in the pod before they run, and the daemon pauses the idle timer while they stay registered. If the connection drops, the registered work aborts. When the workspace stays idle for the timeout, the daemon exits, which ends the pod and keeps its volume. Other container drivers start a detached daemon whose exit does not stop the container. See Auto-Inactivity Timeout for activity rules and pod-layout restrictions.
Any UID in the same container can block inactivity through a live activity connection. Only root and the daemon's UID can change setup or timeout policy. Do not expose the activity socket outside its container.
Machine providers
Stopping only the container leaves the VM running and billed. Define agent.exec.shutdown with a command that stops or deletes the machine on the cloud side. Set the timeout with inactivityTimeout. Each official cloud provider does this differently. One calls a cloud API with a token saved in an option.