| kind | fixed | ||||
|---|---|---|---|---|---|
| title | A runner's saved slots now change how many jobs it runs at once, higher or lower, without a restart | ||||
| pr | 0 | ||||
| surface |
|
||||
| invalidates |
|
Slots are bounded to 1..8 (api.MaxRunnerSlots); the server answers 422 outside
that range. Eight is a deliberate safety ceiling on credentials, git worktrees
and stage conversations in one process, rather than a measured throughput limit.
Legacy saved values above eight are granted eight. Missing legacy settings use
the same default of two shown in the roster, and the execution copy follows that
single saved setting. These migrations leave existing leases running.
Lowering never cancels a job: a slot above the new number finishes what it holds and then leaves; new work waits until the factory's cap has room. Raising starts the missing slots within one read. An already-authorized pull also rechecks the saved capacity before reserving another job.
GET /v1/runner/self takes the runner's own worker credential only and answers
{"slots": n}, nothing about any other runner or owner. A person's token gets 401.
The attach answer now carries the saved slots. An older factory without the
route answers 404; the worker then keeps the number it has. An older worker keeps
its fixed slots and the factory's cap still applies to it.
A worker that follows capacity attests it once, at attach, in the
X-Codeaf-Live-Capacity: 1 request header, and the roster lists that runner with
live_capacity: true. The attestation is deliberately not in the attach JSON: a
factory from before it decodes that body strictly and would refuse an unknown
field with 422, but it ignores headers, so a new worker attaches to it on the
first and only POST (never retried or downgraded) and simply is not listed as
live. A runner listed without live_capacity is an older binary or a worker
that cannot read its capacity; a restart alone does not change that, since an
older binary stays at its fixed 2. It needs a compatible update or
configuration, and no screen may promise a raise after a restart.
Not in this change: pause, remove, joining another machine, and any app wire verb or control for slots.