Worker Architecture
Worker enrollment, heartbeat, capacity reporting, task claim, sandbox preparation, agent adapter execution and cleanup responsibilities.
Enrollment and identity
The source design uses a short-lived, single-use enrollment token. A worker creates a keypair and sends the token, public key and machine fingerprint over TLS. The control plane registers the worker and issues a short-lived client identity; approval may be required before the worker becomes schedulable.
Capacity and health
Probes can report CPU, RAM, disk, OS/architecture, container runtime, browser support, labels and region. A heartbeat includes current capacity, reservations, worker version and active lease identifiers. Heartbeat intervals and suspect/lost thresholds are initial targets that need tuning.
Claim and run
The worker claims a lease, verifies the current attempt and generation, prepares a per-attempt workspace/container, mounts only scoped credentials and starts the declared adapter. It reports heartbeat, events, usage and compatible checkpoints.
Network posture
The initial MVP favors workers making outbound HTTPS long-poll or stream connections to the control plane. A worker should not expose a public inbound execution port. Egress is intended to be deny-by-default with explicit allowlists; internal metadata networks should be blocked unless approved.
Cleanup contract
On terminal state, cancellation or expiry: revoke scoped credentials, kill the process tree, close browser processes, unmount the workspace, remove temporary files, release ports and resource reservations, then report cleanup state. A janitor reconciles any orphaned environment.