Skip to content

Computers on Fargate

A computer is where a person’s cloud agents work, with its own desktop and browsers. The code calls it a box. Every person who joins in the app gets one, pipeline runs that need one claim one from the team’s pool, and a task’s coding attempts each get a coding computer. On gomoe.dev every computer is a Fargate task, since host.ts writes AGENTS_COMPUTE=fargate into the server’s .env. The driver is server/compute/fargate.ts.

Part On gomoe.dev
Cluster agents-computers, in the stack’s private subnets.
Task definition Each computer registers its own, copied from agents-computer-base with its size and its home. The container is named computer.
Platform Linux on ARM64, the same as the server host that builds the image.
Home An EFS access point rooted at /homes/<instance id>, mounted at /home/agent in the computer, with encryption in transit. The server host mounts the same file system at /mnt/agents-homes, so it reads and writes a home as files while its computer sleeps.
Network The security group agents-computers. What computers may reach lists it.
Capabilities NET_RAW dropped, so a computer cannot send raw network frames or capture packets.
Logs The CloudWatch log group /agents/computers, under the prefix computer.
Server address AGENTS_BOX_API, http://server.agents.internal:7700, by the private name.

Computers start from the image in the stack’s registry, agents-computer, tagged latest. Two things build it on the server host, from box/Dockerfile through server/boxes.ts build.

  • node ops/aws-deploy/deploy.ts --image from a laptop, for the commit the server runs. It refuses any other commit.
  • follow.ts, after each deploy of main that passed.

Each build pushes the image tagged with its commit. By default it also pushes a copy with a lazy-loading index as <commit>-soci and tags that copy latest. With --no-soci the commit’s image is tagged latest. The build prunes older images and build cache after. The image holds Node 24, a Linux desktop (Xvnc and JWM), Playwright’s Chromium, Firefox and WebKit, Claude Code and the daemon. It carries the playbook set installed on the building host, or the one AGENTS_BOX_PLAYBOOKS names. With none, the build warns and the image holds /opt/agents/playbooks/NO-PLAYBOOKS. Its computers then load the plugin only when the team has published playbooks of its own, which the daemon fetches over the machine port.

The runner moves running computers to the newest image, up to 2 a minute, by making each again from that image on the same home. It moves a person’s own computer, a pool computer a person keeps, and a coding computer that is up, and only while it is awake with nothing in hand, as MOVABLE in server/boxes.ts says. A busy one moves once its work ends. A computer asleep or stopped, and a pool computer nobody holds, starts from the newest image the next time it starts.

Computer Seats CPUs Memory
A person’s own 4 4 8 GiB
A pool computer 1 2 4 GiB
A task’s or a chat’s leased computer, by size 1 coding 1, desktop 2, proof 2, light 0.5 2, 4, 6 and 1 GiB
A coding computer 1 AGENTS_CODING_CPUS, 2 AGENTS_CODING_MEMORY_GIB, 4 GiB

A light computer has no desktop. The sizes are the AGENTS_SIZE_* settings in server/computer-sizes.ts. The driver gives each computer the smallest Fargate task size with at least its CPUs and memory.

The room is 64 vCPUs and 256 GiB, AGENTS_FARGATE_MAX_VCPUS and AGENTS_FARGATE_MAX_MEMORY_GIB in host.ts. hostFree in server/coding.ts counts people’s awake computers, coding computers that are not gone, admitted task, chat and warm leases, and job image builds against it. What a new computer does when the room is short depends on its kind and on whether its team has a plan.

  • A coding computer waits, with host_full, on any team. Its count also takes in every other running computer (placeAttempts in server/coding.ts).
  • A task’s or chat’s computer, on a team with a plan, takes a warm computer of its size when one is free, and otherwise gets a new computer whose lease waits until the runner lets it in (leaseComputer in server/task-computers.ts). On a team with no plan it gets no computer, and the task or chat runs on the agent’s home computer instead (server/launch.ts, leaseChatComputer in server/chat-computers.ts).
  • A warm computer is kept only on a team with a plan, and the pool starts none while the room is short (server/warm-pool.ts).
  • A pipeline run’s pool computer waits for room only on a team with a plan. On a team with no plan the room is not checked (claimBox in server/boxes.ts).

A stopped computer holds none of the room. A person’s computer wakes without asking for room, so awake ones can pass it. host.ts names the account’s Fargate quota as 140 vCPUs in a comment, and the repo holds no other record of it. The AGENTS_BOX_HOST_* settings size the room only on a Docker host. On gomoe.dev the API still checks at start that one coding computer fits in them, which it does at the defaults.

host.ts writes none of these, so gomoe.dev runs on the defaults. A value set by hand in /srv/agents/.env is lost at the next deploy, which writes the file again.

Setting Default What it does
AGENTS_MAX_BOXES 2 The most pool computers a team may have, which pipeline runs claim. A run’s claim takes a free pool computer, or makes one while the team has fewer than this, and otherwise waits with the note Waiting for a free box. (claimBox in server/boxes.ts). People’s own computers, coding computers and the computers a task, a chat or the warm pool holds do not count, and a run never takes one of them.
AGENTS_BOX_IDLE_MIN 30 Minutes a person’s own computer, or a pool computer nobody holds, runs with nothing to do before it stops.
AGENTS_CODING_TEAM_LIMIT 8 The most coding computers a team has. 0 turns coding computers off. The most is 64.
AGENTS_CODING_WARM 1 Warm coding computers kept for each team that asked for an attempt in the last 24 hours. The most is 8.
AGENTS_CODING_CPUS 2 CPUs for each coding computer.
AGENTS_CODING_MEMORY_GIB 4 GiB of memory for each coding computer.
AGENTS_CODING_IDLE_MIN 120 Minutes with nobody speaking to an attempt whose work is saved, before its computer goes.

The API refuses to start when one coding computer could never fit in the room.

The runner keeps running every computer a person or an active run holds, and starts one that sleeps when something needs it. A pool computer nobody holds stops after it has been idle for AGENTS_BOX_IDLE_MIN minutes. Coding and leased computers are not stopped this way. A person’s own computer sleeps once it has had nothing to do for that long, and wakes when something needs it, such as a turn for one of its agents. A helper an agent started that still works after its turn keeps either kind awake. That lasts until the session’s Claude process exits, the daemon starts again, or 30 to 35 minutes pass with nothing heard from the session. While the helper waits on a person’s approval, silence ends it no sooner than 24 hours after the ask. A stop or an interrupt for the session ends it at once. A stopped computer keeps its home on EFS, so it starts again with its workspaces in place. On a team whose admin turned bucket sleep on, a person’s own computer that has slept past its plan’s bucket-sleep-minutes has its home packed into the object store and removed from EFS, and the home is unpacked again before the computer next starts.

A chat’s leased computer that has had nothing to do for its plan’s idle-minutes, or 10 minutes on a team with no plan, unless someone asked for its desktop, saves the agent’s home and is removed. The chat’s next turn asks for a computer again, and a new computer restores what was saved. On a team with a plan it gets one as Room on Fargate says. On a team with no plan, while the room is short, it gets none and does not move home. Its turn waits on the released computer, and the scheduler asks again each time it places the session’s turns (reletSession in server/relet.ts, placeSession in server/scheduler.ts).

A team’s admin chooses when computers start, and a new team starts on balanced. On cheapest nothing starts before work reaches a computer. On balanced, opening a chat with an agent or typing in it keeps the agent’s home computer up for 10 minutes, when the team’s chats run on the agent’s home. On fastest that holds too, the app opening or getting focus wakes its person’s own computers for 10 minutes, and through the team’s working hours the own computers of people with a turn in the last 28 days stay up.

A team on a plan whose warm-pool is above 0, and that leases computers to its tasks or chats, keeps that many desktop computers started for no one, so its next task or chat takes one at once. warm-light-pool keeps light computers the same way for a team whose chats are light.

server/boxes.ts also takes create <team> <name>, recreate <team> <name> and list. ops/aws-deploy/admin.ts runs only server/admin.ts and the billing commands, so no laptop tool runs these on gomoe.dev.