Engine shape
One thread serves and works: that is the default on every machine, and what a
forge with FORGE_ENGINE unset runs. The split, which moves the engine's
duties onto a Worker of the same process, is an optimisation and is asked for
by name:
FORGE_ENGINE=autolets the machine decide at boot: at least 4 CPUs and a memory limit of at least 1024 MiB (or none known) give the split; anything less keeps one thread, since the Worker costs about 20 MiB and only pays with a core to spare. CPUs are what the scheduler offers held under the cgroup's quota (v2cpu.max, else v1cpu.cfs_quota_us/cpu.cfs_period_us), so a 1-CPU container on a big host counts as 1; memory is the smaller of the cgroup's cap (v2memory.max, else v1memory.limit_in_bytes) and the machine's.FORGE_ENGINE=workerasks for the split whatever the machine.FORGE_ENGINE=inlinesays one thread, in so many words.
Either ask is honoured only on Bun 1.4.4 or newer. Before it, bun:sqlite
keeps the database handles of every thread in one table with no lock, and a
Worker that opens the database beside the serving thread can end the process
(#12538). On an older Bun the forge runs one thread and says so.
A hosted child, a read-only standby and a test boot stay on one thread whatever the variable says.
The default is a safety default for uptime, not a limit on work: the duties are the same on either shape. On 2026-11-14 a release chose the split from the machine's size alone and production restarted for 4.5 minutes at boot.
When the Worker cannot be had
The forge stays up. A Worker that cannot be made, cannot be told its settings,
or dies 5 times inside 10 minutes is given up: the log says so in one line at
error level, the serving thread takes the duties back, and the forge runs one
thread until its next start. /system then reads one thread with what
happened, and an admin's needs list carries one line linking there.
How the serving thread knows the engine is alive
The engine beats every second (beat.ts): a message of h and the jobs that held its loop
longest in the last two seconds, at most three, as name=12ms. Any message from the engine
counts as a word; one silent past STALL_MS is ended and started again, and the log line says
why=silent with quietMs and lastJobs, the jobs of its last beat. inMs on that line is the
wait before the restart, not the window.
The watch runs on the serving thread, so a stall there delays the engine's beats behind it. A watch tick that comes more than two beats after the one before is the serving thread's own lateness: the gap is forgiven and the engine's window starts again. This is bounded: it applies to a late tick only, so an engine that is truly hung is ended on the next on-time tick.
Which shape runs
Open /system and read "Engine shape", or open the System command in the
terminal. Both read the same choice, made once at boot (engine/mode.ts), and
the reason in words.