Who runs next when the agent pool is full is the question the runtime answers by accident. Agent Substrate rejects with substrate worker pool has no free workers and does not queue. Callers retry, and the retry that lands when a slot frees wins, regardless of why the work exists.
I have the error on a sticky note. My client retries. Your batch job retries faster. The batch job gets the slot. The on-call agent looks broken. That is not a bug in packing. Packing is working. Scheduling agent sandboxes is the design. This is the incident.
What happens when the pool says no free workers?
The density story is real. I have run 18 agents on two worker pods, and the published lab was nine on two, reserved capacity about 4.5x lower than always-on pods. One actor per worker. Simultaneous sessions equal worker count. Total agents equal snapshots. When every bay is taken, the runtime has nothing left to multiplex onto.
It does not wait. It does not rank. It returns the error and lets the caller decide what “try again” means.
So the queue is not missing. It is distributed. Every retry loop is a queue of one, with its own backoff, its own timeout, and its own opinion about how rude to be. The client that retries most aggressively wins the next freed slot. Nothing in that race tracks importance. A batch agent doing overnight enrichment with a tight retry loop beats an incident responder with a polite backoff every time.
This is the first failure mode I named in agent runtimes have an autoscaler, not a scheduler: the noisy neighbor wins by retrying hardest. The second is the default, not the edge case. A low-priority actor that got a slot holds it for the length of its session, and sessions with an LLM in them are long and variable. A critical agent arriving a second later waits for a turn it cannot jump. The third is what happens if you “fix” the first two with strict priority and no counterweight: the bottom of the list never runs, because busy is the only state anyone cares about.
Autoscaling delays this. It does not decide it. The Scope policy I shipped is target = busy + queued, clamped to [2, 8]. That is a count. It buys time until the replica ceiling, the node pool, or the model rate limit. Then I am back here. CPU is the wrong signal.
How do I instrument a race the runtime cannot see?
If you only scrape ateapi, you will miss the clients that already backed off. Demand lives where the rejection is handled.
- Count the error at every caller.
substrate worker pool has no free workersis the unmet-demand metric. The runtime does not export a pending-restore queue today. Your retry loop is the queue. - Occupancy from the workers list. One row per worker pod, naming the actor it currently hosts. Derive assignments from that list, not from the actors list. Suspended actor entries grow without bound. Mine passed 900 in a day in the first lab and started returning partial results under load. kubectl is lying to you if you use pod CPU. Workers hosting active sessions measured at single-digit mCPU. A quiet CPU graph is compatible with a full pool.
- Time-to-slot from the caller’s point of view. That is the SLO the user feels. Pool-side occupancy will not tell you that the on-call agent waited through three batch retries.
Ghost occupancy is a special case of “full”: the pool looks empty and still rejects. A session killed mid-flight (timeout, cancelled chat, API outage) can leave its actor pinning a worker slot, sometimes as a ghost that no longer appears in the actor inventory. On a two-worker pool, one ghost is half your capacity. Two is all of it. Reset first. Ghost actors. The workers list still shows a busy bay. The actors list and the pod list do not.
I scale on sustained rejections. That is an autoscaler. Up on queue depth, down on occupancy over a trailing window, floor of two so one long session cannot block every other agent. Then the model backend becomes the next ceiling. Extra workers on a serial generator made every turn slower. The queue moved from my callers to the model, where the board could not see it. The autoscaler made it worse.
What would I ship this week, not this year?
Separate pools for interactive and batch. Crude. Works. No new CRD. An incident agent and a nightly enrichment job are not competing for the same guarantee if they are not competing for the same WorkerPool.
If they must share, a proxy in front of resume with a FIFO per class and a reserved floor for interactive. Fair share if you can. Strict priority if you like starvation. The longer design is in scheduling agent sandboxes: a resume queue you own, preemption only for waits that are suspend-safe, a free-worker buffer, and classes as a Kubernetes object with quota so “critical” is expensive.
Do not add jittered retries and call it fairness. Jitter only changes who wins the race. It does not encode that the pager matters more than the enrichment job.
Do not put priority: 10000 on every Agent object. Everything becomes critical, which is arithmetically identical to nothing being critical. Kubernetes already solved the arbiter problem one layer down: PriorityClass is cluster-scoped, and a ResourceQuota can bind to it. Port that shape to slots. Do not reuse pod PriorityClass as if it could see actors. It cannot.
Do not wait for Kueue to fall out of the sky onto a WorkerPool. Kueue’s unit is a Workload that becomes pods, decided once at admission. You need a per-session decision about a warm slot. Right shape, wrong granularity.
Why is this a correctness bug for RL, not only a latency bug?
A biased subset of rollouts is a biased gradient. If the pool is full and retries pick an arbitrary subset of the step, you did not train on the batch you wrote down. You trained on the batch that won the race.
For training I would start with fair share across rollouts in the step, not “interactive beats batch,” because here the rollouts are the job. Scheduling sandboxes for RL. Keep GPUs on the model side so a restore storm is a generator queue, not a device pinned inside a snapshot you cannot take. GPUs for agents on Kubernetes.
Agent-to-agent fan-out makes the same race worse in production. Most sessions will not start from a person. They will start from another agent. That is a load generator you do not have an SLA for. Put A2A on a different pool, or a different class, before a recursive loop fills the interactive floor. Agent platform at scale.
Checklist: catch the race before it becomes the outage
- Log and count
no free workersat each caller, with agent name, tenant, and whether the work is interactive, batch, or A2A. - Alert on sustained rejections, not on worker CPU.
- Board the workers list. A busy bay with no live turn is a ghost. Reset the pool.
- Measure time-to-slot at the caller. That is the number a human feels.
- Cap retry aggression on batch and A2A. Do not let enrichment out-hammer on-call.
- Split pools, or put a classed proxy in front of resume, before two teams share a ceiling.
- Treat a full pool plus a serial model as two different incidents. Adding workers can make the second one worse.
Field guide: Agent Substrate. The lab write-up is kagent Agent Substrate.