This process is intentionally separate from the Next.js web process. The web user must not have access to a Docker socket. Run pnpm task:worker (the supplied systemd unit invokes the same checked-in TypeScript entrypoint through tsx) as the dedicated agentcode-runner user against that user's rootless Docker socket.
Required environment:
TASK_RUNNER_ENABLED=trueDATABASE_URL=postgresql://...DOCKER_HOST=unix:///run/user/<agentcode-runner-uid>/docker.sock
Before enabling the unit:
- Confirm cgroup v2 exposes
/sys/fs/cgroup/cgroup.controllers. - Confirm
docker inforeportsrootlessfor the service user. - Preload the exact manifest image digest. The worker uses
--pull never. - Run the malicious patch and container-limit tests from
tests/runner. - Keep
TASK_RUNNER_ENABLEDfalse on both web and worker until the 14-day product and reliability gate is met.
The worker claims one PostgreSQL queue row at a time with FOR UPDATE SKIP LOCKED. It never accepts a command from the submission: commands come only from the repository-owned challenge manifest.