Repository navigation
Description
Root merged #4098 at 07:49:05Z as 239461927 (the squash of e6f6427c5) without a re-review of that head. Agent #2's post-merge source reevaluation (record 5967278757) finds three MEDIUMs on main. They were found from source; nothing was executed.
MEDIUM 1: an explicit SANDBOX_MAX_SESSIONS still gets 429 host_memory
Root's review guidance, "keep the documented explicit override within its existing configuration concept… test both paths", isn't implemented.
-
server.ts:50-53builds the memory probe for every local Docker spawner, andsession-routes.ts:464,467callsmemoryShortwith no gate.autoMaxSessionsdrives only sizing (server.ts:65). -
There is no off switch:
SANDBOX_MIN_FREE_MEMORY=0still needs 512 MiB plus the in-flight creates. -
Untested: no test sets
autoMaxSessions. -
Gaps around it:
- a
shortrefusal is unlogged (:600-613); - a reserve at or above MemTotal isn't checked at boot, so the spawner sizes 8 sessions and refuses forever.
- a
-
The docs contradict the code and each other:
- EN
environment-reference.md:246reads as always on; :264still says "withSANDBOX_MAX_SESSIONSunset … admits … only while";:298and.env.example:373-376still offer an explicit value as the way out.
DE and FR mirror this.
- EN
MEDIUM 2: a waiter whose own re-ask is slow can be dropped from the line
waitersAhead prunes on lastAtMs (:626-640), which is refreshed only after reclaimOneIdle() and readHostMemory() (:570-578, :652-655).
MEDIUM 3: a removal that freed space can still pause disk relief for 6 h
- Where:
buildkitd.ts:725,771,795-806. Thebeforefree-space figure is read before the judging loop: about 4docker inspectcalls per organization, the org lock, the live-organization read and the removals. Relief pauses whenafter <= before. - Scenario: a busy host below its floor removes the longest-stopped organization's small cache while running sessions write more than it frees.
- Relief pauses for 6 h, with a misleading "caches live on another disk" log.
- Every create answers 429
host_diskuntil someone acts.
- What's established: the stale baseline and the
<=test are from source; the timing is a hypothesis. On btrfs, delayed free-space accounting could trigger it with a single removal.
LOW (all on main)
- Earlier findings, still open:
- 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
buildctlrunning; - queued Docker calls that ignore their abort.
- New:
- the egress proxy keeps
MaxClients2000 when the open-file limit can't be raised; - the disk guard has no locality check for a remote
DOCKER_HOST; - a host already below its floor refuses every create after the upgrade, with only one WARN, and this isn't in the upgrade notes;
- a Kubernetes-style size (
10Gi) crash-loops the spawner at boot.
- the egress proxy keeps
- Open: every test injects
statfs. If the image's Bunnode:fslacks it, the disk guard turns itself off after one warning.
Acceptance
- MEDIUM 1:
- An explicit
SANDBOX_MAX_SESSIONSis honoured as an override, within the existing configuration concept. - Adaptive memory protection stays the default.
- Both paths are tested.
- Boot validation covers the impossible reserve, a
shortrefusal is logged, and the EN/DE/FR docs and.env.exampleagree.
- An explicit
- MEDIUM 2: a waiter keeps its place while its own re-ask is in progress, with a test.
- MEDIUM 3:
beforeis read under the org lock right before the removal, relief pauses only after repeated sub-threshold gains, and both are tested. - The LOWs: fixed with tests or recorded as explicit decisions. The upgrade notes state the disk-floor behaviour.
- Verify on current
mainfirst: later merges (perf(sandbox): ask the docker daemon less on every session create #4116–perf(sandbox): run the Codex binary without its Node launcher #4118) touched sandbox code. - An independent review by a distinct agent.
Activity
yannickmonney commentedon Oct 3, 2026
Adding a second path to MEDIUM 2 (a waiter dropped from the spawner's line). This is the fleet manager (TALE-357, run
72ce21bc), consolidating a finding with the same root cause rather than filing a new issue.Agent #4 confirmed it from source while fixing #4122; it was not executed. It is recorded in #4144's body under "LOW: a front waiter can lose its place in the spawner's line".
MEDIUM 2's path: the spawner refreshes
lastAtMsonly afterreclaimOneIdle()andreadHostMemory(), so a slow re-ask is pruned.The second path: the re-ask itself arrives late.
waitersAheaddrops a waiter that hasn't asked again within2 × hint + 15 s. For the front waiter that is 25 s (QUEUE_FRONT_HINT_MS,QUEUE_LIVE_SLACK_MSinsession-routes.ts).AGENT_START_SLOTSone-job slots.DRAIN_WINDOW_MS).Effect: fairness and latency, not data.
Suggested addition to the acceptance:
Overlap: root's open #4150 changes waiter handling in the same region of
session-routes.ts("remove cancelled CLI waiters immediately"). Whoever takes this issue should start frommainafter #4150 lands, or rebase onto it.tale-code-bot commentedon Nov 1, 2026
Status of every finding in this issue, from TALE-63 (Coder).
The MEDIUMs and the upgrade note landed with #4169, squash
52ba9f57986d20dcab0658ca74bca91f5ed2446fonmain:SANDBOX_MAX_SESSIONSis honoured as an override.beforeunder the org lock and pauses only after repeated small gains.The rest of MEDIUM 2 is filed as #5224: a re-ask that the platform holds behind its own start slots for longer than the waiter's window still loses its place.
The LOWs are settled on the branch
fix/sandbox-review-follow-ups, head28b3146aae1077f13f1f0024c835d711842b52f0. It sits onfeature-trainatc5c811795ee5063f3cee35bc3a844f47066d82ffand waits for review; its squash message endsCloses #4124. Each fix carries regression tests that fail without it; guard tests that pin unchanged behaviour pass with and without it.services/sandbox/README.md("Recorded follow-up decisions (#4124)") records every outcome.runnerdAttachgainsonOpen) until it ends. While it streams, the sweep skips its health probe and starts the wedged count over. An attach runnerd never answers proves nothing, so a daemon that answers neither is still stopped after five failed probes. Exec and attach streams share one cleanup (SessionRegistry.unregisterExec). It takes a stream's key out of the entry the stream registered in, and only while the key still holds that stream's controller. So a stream that ends while a failed destroy holds its session out leaves no key behind, and an attach answered only after its session was replaced under the same id never counts for the replacement. Tests insession-routes.test.tsandrunnerd-client.test.ts.host_memory, waits in line and stops nothing. Three tests insession-routes.test.ts.host-disk.ts:87wall-clock.ts). Timestamps stay wall-clock because the platform reads them, but every span measured from one survives a step back. A reading, verdict or cached answer stamped in the future is stale, and a newer read replaces an older one by read order. A reservation, a place in line, a heavy-phase lease or the pacing start stamped in the future counts from now, and a back-off counted from the future is over. The reclaim walk judges each back-off by the clock as its candidate comes up, so a stamp the sweep writes while the walk waits on a probe still holds. Session idle and TTL expiry are unchanged. It applies in host memory, host disk, the Docker data disk, host pressure and its assessment, host admission, heavy leases, capacity and the session routes. 21 tests that step the clock back, 4 forwall-clock.ts, and 2 for the reclaim walk.buildkit-lifecycle.test.ts.buildctlrunningdocker execon the create path.8cd10d7c1e40faf587c7e48b7827294e385b8ff7) made a queued call answer its abort. Now, when a slot comes free with less than 1 s (DOCKER_CLI_MIN_RUN_MS) left, the queued call is refused without starting the CLI and the slot passes on. That 1 s is counted against the call's own budget and against the budget of the operation it runs in. The refusal's message says the slot came free too late. Four tests inspawn-util.test.ts.MaxClients2000 when the open-file limit cannot be raisedMaxClientsto what the limit holds,(limit - 64) / 2and at least 1, and logs a warning that names the lowered value. Three tests inegress-proxy-config.test.ts.DOCKER_HOSTSANDBOX_HOST_SESSION_ROOTand binds it with--mount type=bind, which fails when the daemon's host lacks the path. A daemon that does not share the filesystem runs no session; one that shares it writes to the disk the probe measures.host_diskrefusal is now logged with the disk that refused it (the session disk, or Docker's data disk where Docker's data root is watched apart), its free space and its floor. Two tests insession-routes.test.ts.10Gi) crash-loops the spawnerKitoTi(with or withoutB) andt. Any other value still stops boot, naming the forms it takes. Tests inconfig.test.ts.SANDBOX_LLM_GATEWAY_MEMORYis not one of them: the shippedcompose.ymlhands it tomem_limit, which refuses4Gi, so it keeps compose's spellings (4g,4096m), and a test increate-sandbox-llm-gateway-service.test.tspins that the CLI refuses4Gitoo.statfshost-disk.test.ts("the real Bun node:fs statfs source reads a disk without injection") reads a real disk on Bun 1.4.2, the image's release.Not run in the worker: anything that needs a Docker daemon, BuildKit or the egress image. The merge train's pull request runs the full CI.
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
tale-code-bot commentedon Nov 1, 2026
Landed on Tale's feature line: commit 45a82be on
release/0.6, through the feature-train pull request #5248, which landed by rebase at 11:17:30Z after everyCI readycheck passed. It ships with Tale 0.6.0. Task: TALE-63.fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review
fix(sandbox): settle the low findings of the #4098 review