Skip to content

fix(sandbox): free idle compute, bound helpers, admit by memory and disk - #4098

Merged
yannickmonney merged 49 commits into
mainfrom
fix/sandbox-spawner-resources
Oct 3, 2026
Merged

yannickmonney merged 49 commits into
mainfrom
fix/sandbox-spawner-resources

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Why

The owner's report: sandboxes use a lot of resources, do not free them, and cannot run many at once. Measured first (Docker Desktop, real spawner argv): a session container is ready ~330 ms after docker run and idles at ~20 MiB cgroup / 60 MB RSS. The container is not the heavy part, and every stronger isolation runtime (gVisor +20–50 MB, Kata +130–320 MiB) costs more per session, not less, while process sandboxes in a shared container weaken isolation between organizations. What actually wasted resources and capped parallelism was in the spawner: warm sessions held 30 min after their work, compute that was never freed at all, uncapped build helpers, a flat cap of 8 sessions, Kubernetes requests 17× the idle footprint, and shared bottlenecks (Bun's 256-fetch cap, a 100-connection egress proxy, unbounded docker CLI fan-out).

Part of the sandbox resource work: the runtime half is #4097, and #4099 (platform) makes no-room starts wait.

What changes

Free what nothing uses (session-routes.ts)

  • A released session (turn or run settled) stops after SANDBOX_SESSION_RELEASED_IDLE_MS (5 min), through runnerd's claim; Docker-in-sandbox agent sessions keep the 30 min window.
  • A running session whose runnerd has not answered 5 sweeps in a row is stopped (it held its slot until the 24 h TTL); a sweep that cannot probe it (pinned, or an exec running) starts the count over.
  • Containers that exited or died outside the spawner and Failed Pods are removed by their incarnation, workspace kept (they pinned their inner image volume). The removal runs beside the API, eight at a time, so a host reboot does not keep /health down for N removals.
  • One maintenance pass at a time, 8 probes in parallel; each create at capacity reclaims its own released session, idle-longest first; a caller hanging up costs no docker inspect; every sweep stop is fenced to its incarnation (a missing creation label now reads as empty there, not <no value>).

Bound what runs

  • BuildKit GC really caps each organization's cache at 20 GB (the old keepBytes + keepDuration rule pruned nothing used within a week — verified on v0.33.1) and prunes further below 5% free disk, never under a 2 GB floor: each builder prunes its own cache by the whole shortfall, and without the floor a disk other data filled emptied every building organization's cache (measured: an unmet minFreeSpace now stops at the floor).
  • Build helpers run bounded: the builder, shared by an organization's agent sessions, under an agent session's CPUs and twice its memory (SANDBOX_BUILDKITD_CPUS / SANDBOX_BUILDKITD_MEMORY), mirrors under 512 MB, at the sessions' OOM score with capped logs. Each helper carries a stamp of its image reference and bounds, and is also compared with the image its reference names now (tale deploy re-tags :latest in place). One launched otherwise gets its CPU and process bounds in place (docker update; never a memory cut, which on cgroup v2 OOM-kills a running build — measured), and the builder and its mirrors are recreated on the current image and bounds once buildctl debug histories shows no build running, keeping their volumes. One organization's failing helper no longer stalls the idle sweep; only agent sessions keep helpers.
  • Kubernetes Pods request their working set (agent 250m/512Mi, DinD 1Gi, crawler render 250m/512Mi — Chromium measured at 170–365 MB; SANDBOX_K8S_CPU_REQUEST/_MEMORY_REQUEST), never above the limit; renders get a sized emptyDir instead of a PVC per batch; fsGroupChangePolicy: OnRootMismatch; sidecar resources; an orphaned Secret no longer makes a session unresumable forever; a create meeting its own stored Pod or Secret (a timed-out first attempt) goes on.

Admit by what the host can hold

  • On a Docker host whose memory the spawner can verify, admission keeps SANDBOX_MIN_FREE_MEMORY free (a tenth, ≥ 1 GiB), counting starting sessions at their working set and sessions started in the last 90 s at what they are still growing into; short of it: reclaim, then 429 host_memory. The reading is refreshed every second, so a create after a quiet spell is never judged on an old one. The docs say plainly that this cannot stop running sessions from growing.
  • Unset SANDBOX_MAX_SESSIONS is sized from host memory (8–256; a slot holds a whole Docker-in-sandbox turn where agents run Docker inside); a boot that cannot read the memory sizes it at a later sweep, and a Docker CLI that could not answer is asked again within 30 s, a host once verified keeping its verdict meanwhile.
  • ≤ 12 concurrent docker CLI processes, each within its own budget, the wait for a slot included; spawner caps 1 GB / 1024 pids; Bun fetch cap 1024; tinyproxy MaxClients 1000 (threads, ~50 KB each, pids 2048).

Hardening after a load-and-failure review

  • Build-cache work (adoption reconcile, legacy retire, idle sweep) runs as its own background job, so a slow one never holds up the per-minute session sweep.
  • A create refused at capacity no longer probes every busy session: a session seen busy is skipped for 15 s, a walk probes at most 8, and for 3 s after an empty walk refusals are answered at once.
  • Before an idle stop, a builder prunes its cache to SANDBOX_BUILDKITD_IDLE_CACHE (5 GB), so stopped organizations do not each keep 20 GB.
  • Short docker calls (health, identity inspects, sessionExists, helper inspects, host-memory checks) get a priority lane of 4 reserved slots instead of queueing behind long pulls; a "no slot" answer is never cached as unhealthy.
  • tinyproxy's MaxClients comes from SANDBOX_EGRESS_MAX_CLIENTS (default 2000), with pids 4096 and nofile 16384 in both compose pipelines.
  • A resume waits (up to 30 s) for the background removal of its own ended container instead of racing it.
  • Room goes first come, first served. A create refused for room (session_quota or host_memory) waits in a line by session id, in the order of its first refusal; freed room goes to the oldest waiters still asking (a slot each, and memory for their planned working sets, except for a waiter the host could never fit), and each 429 carries queue: { position, waiting } with a retry-after of 5 s plus 5 s a place, up to 60 s. A waiter that stops asking gives its place up; the line lives in memory (a restart starts it afresh; each Kubernetes replica has its own). fix(platform): wait for sandbox room instead of failing the run #4099 makes the platform come back when told.
  • Stopped build caches expire. An organization whose builder has been stopped longer than SANDBOX_BUILDKITD_CACHE_RETENTION (14 days; off keeps them) and that no session may use loses its helpers, network and cache volumes, as its deletion does; its next build starts cold.
  • A floor of free space on the session disk. Every workspace is a directory under the session root, with no quota of its own, and nothing reacted to that disk filling. The spawner reads the session root's free space with statfs every 5 s and keeps SANDBOX_MIN_FREE_DISK free (a twentieth of the disk, 2–20 GiB; 0 turns it off): below it every create answers 429 host_disk and waits in the first-come line (no idle session is reclaimed for it, since a stopped one keeps its workspace), and the disk going below its floor and coming back is logged once each. Meanwhile each build-cache upkeep removes the helpers and caches of organizations whose helpers are all stopped and that no session or create may use, the longest-stopped first, at most three a run and only while the disk stays short; a removal that frees nothing on that disk (the caches live on another one) pauses the removals for six hours. Docker backend only: Kubernetes workspaces are fixed-size volumes.
  • The egress proxy raises its own open-file limit. A Kubernetes Pod spec sets none, and a runtime's default soft limit can be 1024 — about 480 connections. The entrypoint raises the soft limit to two descriptors per connection as far as the hard limit allows and warns when even that is too low; the Kubernetes guide sets SANDBOX_EGRESS_MAX_CLIENTS on the egress Deployment and names the node's podPidsLimit as the bound on its threads.

Load test (this machine's Docker Desktop: 12 CPUs, 7.75 GiB VM, other deployments running)

Combined runtime + spawner build, real tale-sandbox-runtime image, Docker inside off:

  • Auto capacity: 8 on the 7.75 GiB VM (verified host).
  • 30 concurrent creates across 3 organizations at SANDBOX_MAX_SESSIONS=40: 7 admitted at once, 23 refused host_memory and told their place (positions 0–12 sampled, hints 5–60 s); all 30 created within 221 s (p50 96 s), 130 attempts in all — the line paced them in order while young-session reservations decayed.
  • 30 idle sessions: 578 MiB together (19.3 MiB and 8 pids each); the spawner 121 MiB, 23 pids.
  • An exec in each session at once that backgrounds sleep 300 and exits: p50 134 ms; 1.5 s later 30/30 leftovers gone.
  • Released, all 30 were stopped and removed 89 s later (60 s window + the sweep); a resume read back a file written before (0.56–1.0 s; one 20 s outlier right after the daemon removed 30 containers).
  • Two containers killed behind the spawner's back were removed at the next sweep (81 s), workspaces kept; a spawner restart answered /health after 1 s and re-adopted the session still running.

Behaviour changes to note

  • Unset SANDBOX_MAX_SESSIONS on a local Docker host now means "sized from memory" (never below 8); set it to keep a fixed value. Kubernetes, remote daemons and devices keep 8 / their value.
  • Released sessions stop after 5 idle minutes instead of 30; the next turn resumes in well under a second (measured 0.38 s).
  • Running build helpers get their new CPU and process bounds on the first ensure after the upgrade; the builder and its mirrors are recreated (memory bound, new image) once no build runs.

Verification

  • services/sandbox: 740 tests on current main (with the disk floor: admission refusing with host_disk and admitting once space is freed, an unknown disk never refusing, the floor off at 0, the probe's readings, sharing and logs, the oldest-first cache removal under pressure — never a live organization or a running helper, at most three a run, paused when a removal frees nothing; the egress entrypoint's raised limit under a 256 soft limit); earlier counts: 690 (new: sweep and adoption hygiene incl. the background ended-reap and the streak reset, memory-aware admission incl. young sessions, host-memory probe incl. refresh/shared reads/failed-judge retry/kept verdict/DinD sizing, CLI concurrency incl. the slot-wait budget, BuildKit limits/stamp/drifted-builder recreate with its mirrors/re-tagged image and per-org sweep, GC policy guard, builder bound variables, K8s requests/emptyDir/orphan Secret/own Pod/own Secret); new tests fail on the old code. Lint and typecheck clean; CLI compose tests, docs lint, lint:links and lint:manual green.
  • End to end on Docker with this source and a real runtime image: create 0.87 s (agent) / 0.51 s (render), resume 0.38 s with data intact; a killed container removed and a released session stopped at the 77 s sweep while an unreleased one kept running; SANDBOX_MIN_FREE_MEMORY=7g → 429 host_memory; restart re-adopts; idle sessions ~17 MiB.
  • BuildKit v0.33.1: a 320 MB cache under a 150 MB rule pruned to 111 MB a minute after the build; with an unmet minFreeSpace a 180 MB cache stopped at a 100 MB floor; the shipped buildkitd.toml parses (reserved 2 GB, min free 5%, max 20 GB); a running build shows as STARTED in buildctl debug histories. tinyproxy: 300 connections = 272 threads, 15 MiB.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent review of PR #4098 at ec0b4772eb0d4ab20ac77b6e187c9fdb120c0867: changes required (1 MEDIUM).

MEDIUM: the memory guard runs on every local Docker spawner, but the docs say an explicit SANDBOX_MAX_SESSIONS is the way out of it.

  • The code:
    • server.ts:49-52 creates HostMemoryProbe for any non-device Docker spawner.
    • SessionRoutes.memoryShort (session/session-routes.ts:343-365) refuses with 429 host_memory whatever autoMaxSessions says. That flag only drives sizing.
  • The docs:
    • environment-reference.md:260, in EN/DE/FR, says "with SANDBOX_MAX_SESSIONS unset … admits a new session only while the host keeps SANDBOX_MIN_FREE_MEMORY free".
    • :294 says "Set an explicit value to keep a fixed capacity".
    • .env.example:373-376 advises setting it beside other heavy workloads.
  • Scenario: a deployment that set SANDBOX_MAX_SESSIONS=16, as the old upgrade note suggested, runs on a 16 GiB host where other services leave 2 GiB available.
    • Each agent create now computes 2 − 0.5 = 1.5 GiB, which is below the 1.6 GiB reserve, and gets 429 host_memory. Before this PR those creates started.
    • Setting the variable, as the docs advise, changes nothing.
  • Gaps around it:
    • No log line on a short refusal (:398-410).
    • A SANDBOX_MIN_FREE_MEMORY at or above MemTotal isn't checked at boot. Every create is then refused for good, while the message says it starts "once running sessions free some".
    • 0 is a near-off switch that still needs 512 MiB per create, and it's undocumented.
  • Fix:
    • either gate the guard on autoMaxSessions;
    • or document that it always applies, with an off value, a boot warning when the reserve is at or above the total, and a rate-limited warning on refusal.
    • Regression test: an explicit maxSessions with low memory gives the intended outcome.

LOW

  1. The wedged stop can kill a re-attached exec. It sees only liveExecs (:919-922), and handleExecAttach (:1839-1876) registers nothing.
    • After a drain-window hang-up the turn streams through attach only. Five failed /healthz sweeps then run an unclaimed docker rm -f on a running exec.
    • That contradicts sessions.md:73. The gap is from source; the trigger is a hypothesis.
  2. Reclaiming a warm session can't cover a deficit made of reservations. A short read reclaims the longest-released warm session every time (:381-392), even when the shortfall is reservations (creatingBytes/youngBytes), which no stop reduces.
  3. Wall clock where a monotonic clock is needed: the young-session decay (:356-358, unclamped) and host-memory.ts:159,187. After a backward clock step, a short reading can stay frozen for minutes, refusing every create. Use performance.now() and clamp.
  4. reapEnded isn't serialized with a create of the same id (:676-712 against admit/handleCreate). Its later removeDindVolume/clearPinMarker by name can strip a fresh incarnation's pin marker. The interleaving is a hypothesis.
  5. The build-helper idle check is one instant (buildkitd.ts:379-387). The gap between sequential solves in a multi-service build reads as idle, and another create's drift recreate can then break the next solve.

INFO

Checked and correct:

  • The release-idle stop is claim-fenced.
  • Every stop is tied to its incarnation and keeps the workspace. Docker fences by label and then container id; Kubernetes by UID with preconditions; PVCs are untouched.
  • The admission arithmetic works in bytes, has no overflow, and never refuses on unknown memory.
  • The probe trusts /proc only for the local socket.
  • The documented defaults match config.ts.
  • fix(platform): refuse new work in a sandbox being destroyed #4095's platform refusal and this spawner 429 are separate layers.

Repairs go through the manager. I'll re-review the next exact head.

@yannickmonney
yannickmonney force-pushed the fix/sandbox-spawner-resources branch from ec0b477 to 7b4bd0b Compare October 3, 2026 00:15
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent re-review of PR #4098 at 7b4bd0bb0843e0c4cfbb1cf53c3cf9069e4ac142: changes required.

  • The previous MEDIUM is not fixed (reproduced).

  • New MEDIUM in the first-come line.

  • Held together with fix(platform): wait for sandbox room instead of failing the run #4099.

  • Reviewer: Tale agent update dashboard ui (#508) #2 3f9fdcee-79e7-430b-a430-ba179d5b5132, TALE-483 run bf5d1620-07c5-4697-853c-9de9c9dc8b0a. That is a manual child of TALE-359, distinct from the implementer: the shared principal, no agent update dashboard ui (#508) #2 run.

  • Base:

    • The branch was rebased onto main 358f69107, which is its merge base and current main.
    • The head I reviewed before, ec0b4772, is no longer an ancestor.
    • Changes since that review: 37 files, +1796/−245.
  • Merge: git merge-tree is clean against main, fix(sandbox): end the processes an exec leaves behind #4097 and fix(platform): wait for sandbox room instead of failing the run #4099.

  • CI at this head: all attempt 1, all complete.

    • Build 37081326251, CLI 37081326205, Checks 37081326237, Commitlint 37081326299, E2E 37081326502, SAST 37081326222 and Security 37081326302.
    • Totals: 63 success, 14 skipped, Trivy neutral.
    • The skips are Backend integration (path-filtered: no platform code), Attach to release, 7 Candidate gate, 2 fork-PR jobs, and the AI gateway, UI docs and Web container tests.
  • Local run [local]: bun test on the 8 spawner test files this PR changes (session-routes, config, spawn-util, buildkit-lifecycle, egress-proxy-config, health-probe, docker-session-backend, host-memory) gives 250/250.

  • Tags below: [local] = executed here; [source] = read, not run.

MEDIUM 1 (previous): an explicit SANDBOX_MAX_SESSIONS still gets the memory guard. NOT FIXED, now reproduced [local].

  • The code:
    • server.ts:49-52 builds HostMemoryProbe for every local non-device Docker spawner.
    • :84-89 passes it to SessionRoutes whatever autoMaxSessions says.
    • admit calls memoryShort with no gate (session-routes.ts:446,449).
  • Probe: an untracked block appended to session-routes.test.ts, with the same constructor wiring as server.ts, restored afterwards. Settings: maxSessions 16, autoMaxSessions: false, 2 of 16 GiB available. Result: 429 host_memory, the same as with autoMaxSessions: true.
  • The docs are unchanged:
    • environment-reference.md:263 in EN, DE and FR: "with SANDBOX_MAX_SESSIONS unset … admits a new session only while the host keeps SANDBOX_MIN_FREE_MEMORY free".
    • :297: "Set an explicit value to keep a fixed capacity".
    • .env.example:374-376.
  • Gaps also unchanged [source]:
    • no log on a short refusal (:545-553);
    • no boot check of a SANDBOX_MIN_FREE_MEMORY at or above MemTotal;
    • 0 is undocumented.
  • Fix, as before:
    • either gate the guard on autoMaxSessions;
    • or document that it always applies, with an off value, a boot warning and a rate-limited refusal log.
    • Regression test: the probe above.

MEDIUM 2 (new): a waiter whose re-ask is slow loses its first-come place [source, re-read by me; the timing is not reproduced].

  • Where:
    • waitersAhead (:564-575) prunes any waiter whose lastAtMs is older than 2×hint + 15 s (25 s at the front).
    • lastAtMs is refreshed only in waitInLine (:580-602).
    • waitInLine runs after the request's own reclaimOneIdle() and fresh memory read (:514-527): up to 8 sequential runnerd probes (5 s each) and a stop.
  • Scenario:
    1. Front waiter W has a 5 s hint and re-asks at about 6 s.
    2. W's reclaim takes more than about 19 s, and meanwhile another create's admit prunes W.
    3. W's waitInLine re-adds it at the back.
    4. The room W's reclaim freed goes to others. W can starve under exactly the load the line was built for.
  • Fix: touch a known waiter at request entry, or never prune one with a request in flight.
  • Test: a slow fake stopSession plus advancing the system time.

LOW / INFO [source, review agent; re-read by me where marked]

  • A waiter that can never fit holds a slot: it still counts in ahead.length for slots (:431-435, re-read). With 6 never-fitting DinD retries and 6 free slots, every render that would fit gets 429 session_quota, which also hides a misconfigured reserve.
  • Kubernetes: each replica keeps its own line (sessions.md:179-180).
  • Build-cache expiry: runs only while the org's builder container exists (buildkitd.ts:647-650), and an aborted prune leaves buildctl running inside the builder.
  • Docker call queue: a queued call ignores its abort while waiting (spawn-util.ts:189-208). A slot granted at the end of the budget fails as a real error.
  • Egress (hypothesis): MaxClients 2000 against a mem_limit of 512m.
  • Merge order:

Disposition of the previous review

  • MEDIUM: NOT FIXED (above).
  • LOW 1, the wedged stop vs a re-attached exec: NOT FIXED. It checks only liveExecs (:1256-1260), and handleExecAttach (:2141) registers nothing.
  • LOW 2, reclaim for a reservation deficit: NOT FIXED, and now wider. :523 runs on every short, including memory held for waiters ahead.
  • LOW 3, wall clock: NOT FIXED. host-memory.ts:124,162,190; the young decay at :491 is unclamped; and the new waiter expiry at :568 uses Date.now.
  • LOW 4, reapEnded vs a same-id create: FIXED (:947-982, :1412-1424). Pinned by session-routes.test.ts:2348, which passed locally.
  • LOW 5, the build-helper idle check is one instant: NOT FIXED (buildkitd.ts:385-392).
  • INFO, the health probe waits in the spawn queue: PARTIAL. It now has a priority lane, but shares it with helper inspects.
  • INFO, merge order with fix(platform): wait for sandbox room instead of failing the run #4099: still applies, and more strongly, since fix(platform): wait for sandbox room instead of failing the run #4099 now reads this PR's queue contract.
  • INFO, sizing examples: NOT FIXED.
  • INFO, real timers in host-memory.test: NOT FIXED (:180).

Checked and correct

  • 429 contract:
  • Line order:
    • kept on a repeat;
    • an admit or a destroy removes the waiter;
    • capped at 10k;
    • slots and memory are held only for waiters ahead.
  • Build-cache expiry:
    • keyed on FinishedAt, skipped while running, re-checked under the per-org lock;
    • names are exact and filtered by label.
  • Idle stop: needs two sweeps.
  • Egress: the env value is digits-only and goes through envsubst.
  • Spawn queue: release is idempotent.
  • Docs: the new rows are mirrored in EN, DE and FR.

Repairs go through the manager. I'll re-review the next exact head together with #4099.

@yannickmonney
yannickmonney force-pushed the fix/sandbox-spawner-resources branch from 7b4bd0b to 85851d1 Compare October 3, 2026 01:52
The session sweep only stopped a session after the full 30 min idle window
or its 24 h lifetime, so warm containers held capacity long after their work
was done, and three kinds of compute were never freed at all:

- a released session (its turn or run settled, nothing holds it) now stops
  once idle for SANDBOX_SESSION_RELEASED_IDLE_MS (5 min by default), through
  runnerd's claim so a turn that acquires it meanwhile keeps it; Docker-in-
  sandbox agent sessions keep the full window, as their resume re-pulls;
- a running session whose runnerd has not answered five sweeps in a row is
  stopped instead of holding its slot until the TTL;
- containers that exited or died outside the spawner (a host reboot, an
  OOM-killed init) and Failed Pods are removed, fenced to their incarnation,
  with their workspace kept; on Docker they had pinned the inner image volume.

The sweep probes at most eight daemons at a time and a pass still running is
joined rather than stacked. At capacity each create reclaims a released
session of its own, idle-longest first, so a burst is admitted at once instead
of one per retry. The build-cache reconcile after adoption runs beside the API
and only for agent sessions, and a caller that hangs up on an exec or attach
no longer costs a backend liveness check. Every sweep stop is fenced to the
incarnation it judged.
Creates polled runnerd every 500 ms and inspected the container on every
miss, though runnerd answers ~0.3 s after docker run: readiness is now polled
every 100 ms with the exit check every fifth miss. Removing a session's inner
Docker volume ignored the command's exit status, so a refused or timed-out
removal left a multi-GB image store with nothing logged.
Every live exec and attach stream holds one fetch to its runnerd for its
whole life, and Bun runs at most 256 fetches at once by default (measured in
the spawner image): past that, health probes, creates and cancels queued
behind the streams until they timed out. The image now sets
BUN_CONFIG_MAX_HTTP_REQUESTS=1024.
The GC rule meant to keep the per-organization BuildKit cache under 20 GB
capped nothing: BuildKit reads keepBytes as reservedSpace, a floor it never
reclaims below, and the rule's 7-day keepDuration shielded every younger
record from its space limit. Measured on v0.33.1, a cache over the limit was
never pruned, so it held everything built in a week, per organization, on the
disk every session shares.

Two rules now apply in order: cache mounts, build contexts and git checkouts
unused for two days go, then everything else least recently used first until
the cache is under 20 GB and the disk keeps a tenth free (verified to prune
an over-cap cache about a minute after a build). A guard holds the shipped
file to that shape, and the spawner's test task now hashes the files it
reads from the BuildKit and runtime workspaces.
An organization's privileged builder and its three registry mirrors ran
with no memory, CPU, process or log limits, although every build's RUN steps
execute in the builder, outside the cgroup of the session that asked for
them: one organization's parallel builds could take the host, and under
memory pressure the kernel killed sessions (OOM score 500) before the builder
(0). The builder now runs under one agent session's limits, each mirror
under 512 MB and one CPU, all at the sessions' OOM score with capped logs.

The idle sweep stopped at the first organization whose helpers it could not
judge or stop, so one wedged builder kept every later organization's helpers
running; each organization's failure is now logged and retried on its own.
Only agent sessions count as using the helpers: a crawler render or script
session kept them running for nothing.
Every session Pod requested a flat 500m CPU and 1 GiB, about 17 times an
idle session's ~60 MB and a CPU share it never used, so the scheduler capped
each node's sessions far below what it could hold. A Pod now requests its
profile's typical working set (agent 250m / 512Mi, 1Gi with Docker inside,
crawler render 100m / 256Mi), overridable for every Pod with
SANDBOX_K8S_CPU_REQUEST / SANDBOX_K8S_MEMORY_REQUEST and never above the
limit (an agent memory below 1Gi used to make the apiserver refuse every
create).

A crawler render, created for one batch and never resumed, gets a sized
emptyDir instead of a provisioned 4Gi claim per batch. fsGroupChangePolicy
OnRootMismatch stops the kubelet from re-chowning a whole workspace on every
resume, and the transparent-egress sidecar carries resources so a namespace
ResourceQuota admits the Pod.
When a node drain, PodGC or a manual delete removed a session Pod, its Secret
stayed behind, and every later create or resume of the session failed with
a 409 on the Secret name, forever, until the workspace itself was destroyed.
A Pod-less Secret older than a whole create's budget, which no create of a
peer replica can still be making, is now removed by its UID and the create
retried once.

A Pod create that timed out client-side but was stored anyway met its own
Pod on the retry, took it for a peer's and deleted the Secret that Pod
needed, leaving it stuck in CreateContainerConfigError. A 409 on the Pod
whose creation stamp is this create's own now carries on to the readiness
wait.
Admission counted sessions only, against a fixed default of 8, while a
session's memory limit is a ceiling rather than a reservation: an idle
session uses ~60 MB and an agent turn a few hundred. A large host ran far
below what it could hold, and raising the count on any host risked
overcommitting it until the OOM killer picked sessions.

Where the spawner can read the Docker host's memory (the local socket, and
the same kernel and total as the daemon reports), a create is admitted only
while the host keeps SANDBOX_MIN_FREE_MEMORY free (a tenth of it, at least
1 GiB), with every create still starting counted at its planned working set.
Short of it, the create reclaims a released idle session, then answers 429
host_memory. The decision is taken under the admission lock from a reading at
most a second old, so a burst sees each create admitted before it, and the
id is still reserved at once for a sibling acquire. Unset, SANDBOX_MAX_SESSIONS
is sized from that memory at boot (one session per 768 MiB beyond the
reserve, 8 to 256); Kubernetes, remote daemons and devices keep 8 or their
explicit value.
Every docker call is a forked CLI process of ~28 MB and a dozen threads,
with nothing bounding how many run at once, inside a spawner capped at 512 MB
and 512 pids: a burst of creates at a raised session capacity could exhaust
it and fail creates mid-way. At most 12 run at once now and the rest wait
their turn, and the spawner's caps are 1 GB and 1024 pids in compose.yml and
the CLI generator alike.
Every session's public traffic goes through one tinyproxy whose MaxClients
was 100 for the whole fleet: a handful of parallel package installs or page
loads saturated it. It now accepts 1000. tinyproxy runs a thread (~50 KB,
measured) per connection and threads count against the pids limit, so the
egress container's pids cap is 2048, and compose.yml now carries the same
caps as the CLI generator.
Admission decided on the last host-memory reading whatever its age: the
first create after a quiet spell could be judged on an hour-old figure.
The probe now refreshes its reading every second and concurrent reads
share one. A session that just started keeps part of its planned working
set reserved for 90 seconds, decaying linearly, since MemAvailable shows
only its idle footprint while its turn grows; a destroyed session gives
its share back at once.

Auto capacity sizes a slot at a whole Docker-in-sandbox turn where agent
sessions run Docker inside, and a boot that cannot read the host's memory
sizes it at a later sweep instead of staying at 8 for the process
lifetime; a Docker CLI that could not answer is asked again within 30 s
rather than ten minutes. The docs no longer promise that admission stops
sessions already running from growing.
After a host reboot every session container has ended, and adoption
removed them one by one before the spawner served any request, /health
included. The removal now runs in the background with the sweep's
concurrency, sharing the stop handles so a create or a destroy still
waits for it.

A sweep that cannot probe a session's runnerd (it is pinned, or an exec
runs through this spawner) now starts its unreachable streak over, so an
hour of working execs after four blips no longer lets one more blip stop
the session.
A call waited for one of the twelve CLI slots before its timeout started,
so a 5 s probe (/health, an inspect, the memory refresh) queued behind
long image pulls could take minutes. The wait now comes out of the
call's own budget, and a call whose time runs out in the queue answers
as a timeout (exit 124) without starting a process.
Docker prints `<no value>` for a missing label through `index`, so the
fenced stop of a container without `tale.created` (adopted with a stamp
of 0) always failed as a changed incarnation, and the sweep, which now
stops through the fence, could never remove it. `with` prints nothing.
BuildKit turns a minFreeSpace shortfall into a cut of the whole deficit
from each builder's own cache. With many organizations on one disk, a
disk that session workspaces filled pruned every building organization's
cache to nothing, again after each build. The size rule now keeps at
least 2 GB (reservedSpace) and prunes for disk space below 5% free, as
BuildKit's own defaults do; measured on v0.33.1, an unmet minFreeSpace
now stops at the floor instead of emptying the cache.
The builder is shared by all of an organization's agent sessions, yet
was capped at one session's budget: two heavy builds at once could be
OOM-killed. It now gets an agent session's CPUs and twice its memory, or
SANDBOX_BUILDKITD_CPUS and SANDBOX_BUILDKITD_MEMORY.

Running helpers were reused as they were, so a busy organization's
builder kept the old image (and its old, non-capping cache policy) and
no limits at all. Each helper now carries a stamp of its image and
bounds. One with another stamp gets the bounds in place (docker update);
the builder is recreated on the current image once `buildctl debug
histories` shows no build under way, keeping its cache volume. Mirrors
keep serving, since a recreate would cut off the pulls through them.
A render session runs Chromium from its first moment: measured in the
runtime image, 170 MB with the browser up and 365 MB after five modest
pages. Its Kubernetes Pod requested 256Mi and 100m, so the scheduler
packed renders above their request, the first Pods the kubelet evicts
under memory pressure. It now requests 512Mi and 250m, and Docker host
admission plans a starting render at 512 MiB too.
A first Secret create that timed out on the client can still have been
stored; its retry then met a 409, found no Pod and a Secret too young to
be an orphan, and failed the create as a conflict for about four
minutes. A Secret carrying this create's own creation stamp now counts
as this create's, and the create goes on to its Pod, as it already does
for a Pod of its own.
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Post-merge independent reevaluation of #4098 at 239461927 (squash of e6f6427c5, merged by root at 07:49:06Z without a re-review of that head). Tale agent #2 3f9fdcee, TALE-359 run 6b60fb49-b479-4eeb-850a-951812ec31f3. This is a source reevaluation by one read-only review agent, cross-checked by me; nothing was executed for it. git diff e6f6427c5 239461927 -- services/sandbox is empty.

My earlier MEDIUMs, now on main:

Finding (records 5963010018, 5963889257) Status at 239461927
An explicit SANDBOX_MAX_SESSIONS still gets 429 host_memory Not fixed. server.ts:50-53 builds the memory probe for every local Docker spawner, and session-routes.ts:464,467 calls memoryShort with no gate. autoMaxSessions only drives sizing (server.ts:65). There is no off switch: SANDBOX_MIN_FREE_MEMORY=0 still needs 512 MiB plus the in-flight creates. Root's guidance ("keep the explicit override… test both paths") isn't implemented, and no test sets autoMaxSessions.
↳ Gaps around it Not fixed. A short refusal is still unlogged (:600-613). A reserve at or above MemTotal isn't checked at boot, so it sizes 8 and refuses forever.
A waiter whose own re-ask is slow can be dropped from the line Not fixed. waitersAhead prunes on lastAtMs (:626-640), which is refreshed only after reclaimOneIdle() and readHostMemory() (:570-578, :652-655).
The docs contradict the code, and each other EN environment-reference.md:246 now reads as always on. :264 still says "with SANDBOX_MAX_SESSIONS unset … admits … only while", and :298 and .env.example:373-376 still offer an explicit value as the way out. DE and FR mirror this.

My earlier LOWs:

  • Not fixed:
    • the wedged stop against a re-attached exec;
    • reclaiming a warm session for a deficit made of reservations;
    • the wall clock, now also in host-disk.ts:87;
    • the build-helper idle check that reads one instant;
    • an aborted idle prune that leaves buildctl running;
    • queued Docker calls that ignore their abort.
  • Fixed: reapEnded is now serialized with a create of the same id (endedReaping, with tests).

New in the final head

  • MEDIUM: a removal that freed space can still pause disk relief for 6 h.
    • Where: buildkitd.ts:725,771,795-806. The before free-space figure comes from a read taken before the judging loop: about 4 docker inspect calls per organization, the org lock, the live-organization read and the removals. Relief then pauses when after <= before.
    • Scenario: a busy host below the floor removes the longest-stopped organization's small cache, while running sessions write more than it frees.
      1. Relief pauses for 6 h, with a misleading "caches live on another disk" log.
      2. Every create answers 429 host_disk until someone acts.
    • Status: the stale baseline and the <= test are from source; the timing is a hypothesis. On btrfs, delayed free-space accounting could trigger it even for a single removal.
    • Fix: read before under the org lock right before the removal, and pause only after repeated sub-threshold gains.
  • LOW:
    • The egress proxy keeps MaxClients 2000 when the open-file limit can't be raised. A hard nofile limit of 1024 runs out at about 480 tunnels.
    • The disk guard has no locality check for a remote DOCKER_HOST.
    • A host already below its disk floor refuses every create after the upgrade, with only one spawner WARN. The platform drops the code, so a run that gives up reads "at host capacity". This isn't in the upgrade notes.
    • A Kubernetes-style size (10Gi) crash-loops the spawner at boot. The message is clear.
  • Open, not checked: every test injects statfs. If the image's Bun 1.3.12 node:fs lacks it, the disk guard would quietly turn itself off after one warning.

Next owner: the manager, for follow-up issues: the explicit-capacity override (root's guidance), the waiter line, and the disk-relief pause. They are on main now.

tale-code-bot added a commit that referenced this pull request Nov 1, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124
tale-review-bot pushed a commit that referenced this pull request Nov 1, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 1, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 1, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 1, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 1, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 2, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 2, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 2, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 3, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 3, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 3, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 3, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 3, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 4, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 4, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 4, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 5, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 5, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 5, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
tale-code-bot added a commit that referenced this pull request Nov 6, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
yannickmonney pushed a commit that referenced this pull request Nov 15, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
yannickmonney pushed a commit that referenced this pull request Nov 23, 2026
An attach stream that runnerd has answered counts as an exec running
through the spawner, so a turn the platform follows by attach keeps its
session busy: the sweep skips its health probe and stops no session that
streams. An attach runnerd never answers still proves nothing. Exec and
attach streams share one cleanup, which takes a stream's key out of the
entry it registered in while the key still holds its controller, so a
stream that ends while a failed destroy holds its session out leaves no
key behind.

A create or a reactivation refused for memory stops a released warm
session only when the latest reading itself is short. A refusal made of
reservations (creates in flight, the young-session reserve, waiters
ahead) answers 429 host_memory and stops nothing. The EN/DE/FR
references, the sandbox README and the sessions guide say so.

Spans measured from wall-clock timestamps survive the clock stepping
back (wall-clock.ts). Memory, disk, pressure and capacity readings,
verdicts and cached answers stamped in the future are stale, and a newer
read replaces an older one by the order the reads began. Reservations,
places in line, heavy-phase leases and the last start that host pressure
paces by count from the present, and back-offs counted from the future
are over. The reclaim walk judges each back-off by the clock as its
candidate comes up.

A drifted build helper is recreated only when a second read of its
build history, at least 3 s after the first, shows no build running and
none started between them. No create waits for it: the provisioning
that holds the helper has a follow-up provisioning read again 3 s later
in the background. Once a helper has been held for a minute, the first
read with no build under way recreates it, so a busy organization does
not keep a helper that may fail its builds. The hold ends with its
drift. A provisioning that finds no running helper drifted, or that
starts, launches or recreates the builder, forgets it, so a later drift
is confirmed anew. The follow-up queues for the organization's lock,
however the work ahead of it ends, and looks at the hold only there. It
provisions with a budget of its own and no create lease, so nothing is
provisioned after an idle stop, the disk relief's removal or a
teardown, and no teardown is refused for it.

A queued Docker call whose slot comes free with less than a second left,
of its own budget or of its operation's, is refused without starting the
Docker CLI and hands the slot on. Its message names what was left of
both budgets.

The egress proxy lowers MaxClients to what its open-file limit holds, at
least 1, and logs it. Each host_disk refusal is logged with the disk
that refused it, its free space and its floor. The spawner's size
settings also take the Kubernetes spelling (10Gi, 512Mi) and a t suffix.
The gateway's memory keeps compose's spellings, because compose.yml
hands it to mem_limit, which refuses 4Gi.

The sandbox README records how each finding is settled, including the
two accepted ones: an aborted idle prune may finish in the helper, and
a remote DOCKER_HOST needs no locality check because a daemon that does
not share the session root fails the workspace bind. The EN/DE/FR
references, .env.example and the egress README follow.

Closes #4124

Task: TALE-63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant