Repository navigation
Closed
Labels
Description
Split from #3977. Its "Host-headroom admission" criterion asks the spawner to warn at boot when
SANDBOX_MAX_SESSIONS × SANDBOX_AGENT_MEMORY is more than host RAM minus the reserve.
Re-checked against main at b2560c2 (TALE-47); line references are against that commit.
What happens
- No
SANDBOX_MAX_SESSIONSset: the spawner sizes its capacity from the host
(autoSessionCapacity,services/sandbox/src/host-memory.ts:72).- It allows 768 MiB per session, at most two sessions per CPU, and never fewer than 8 sessions
(:41-42). - Memory admission then checks each start against the host's free memory less a reserve
(memoryShort,services/sandbox/src/session/session-routes.ts:1089). - It plans for a 512 MiB working set per agent session (
host-memory.ts:31), not for the
session's memory limit.
- It allows 768 MiB per session, at most two sessions per CPU, and never fewer than 8 sessions
- An explicit
SANDBOX_MAX_SESSIONS: memory admission is off by design, because "the operator
sized the host" (session-routes.ts:1086,:1093). - Nothing compares the session count with the session memory limit.
SANDBOX_AGENT_MEMORY(4g, or 8g with Docker inside,services/sandbox/src/config.ts:1155)
is read only to size the build helper (services/sandbox/src/buildkitd.ts:324).- Its comment says the operator "sizes host RAM for the concurrent-session peak"
(config.ts:1152), but nothing tells the operator when that peak cannot fit. - On Bug: concurrent runs of one agent pile into one sandbox session and can exhaust the host #3977's host (4 vCPU, 15.6 GiB), both paths give 8 sessions of 4 GiB, 32 GiB in all.
- The platform checks counts only.
- Its quota check compares the budget with
/v1/limits
(services/platform/backend/domains/governance/policy-writer.ts:257), which answers only
maxSessionsanddeviceSessions(services/sandbox/src/server.ts:595). - The quota editor states only the count rule (
services/platform/messages/en/sandboxes.yml:26).
- Its quota check compares the budget with
Expected
- A warning. At boot, and when the automatic sizing runs (
server.ts:123), the spawner logs
one warning when the session limit times the agent profile's memory exceeds the host's memory
less the reserve (memoryReserveBytes).- The warning names the three figures and the settings that change them.
- Unit tests use fixed memory figures.
- Whether to clamp as well is the implementer's call, but an explicit setting should not change
silently.
- The figures reach the platform.
/v1/limits(or/v1/capacity) carries the session memory
limit and the host's total, so Settings › Sandboxes can say the same beside the deployment
capacity, in EN, DE and FR. - The sizing rule is documented where the settings are:
.env.example,
services/sandbox/docs/sessions.md,docs/*/self-hosted/configuration/environment-reference.md
anddocs/*/platform/admin/sandboxes.md.
Related
- feat(platform): reserve memory for the database and platform so sandbox sessions cannot starve them #4726 reserves memory for the database and the platform.
- Follow-ups from the #4098 review: an explicit SANDBOX_MAX_SESSIONS still refuses on host memory, the waiter line drops slow askers, disk relief can pause for 6 h #4124's first point made an explicit
SANDBOX_MAX_SESSIONSbypass memory admission. This
warning keeps that and makes the operator's sizing visible.
Activity
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
tale-code-bot commentedon Oct 31, 2026
Landed on
release/0.6with feature train #5197 (#5197, rebased in at 2026-10-31 11:15:15Z) as 7993398 (TALE-245, "feat(sandbox): warn when the session limit exceeds the host's memory").release/0.6was then rebased ontomaindf6105c at 11:25Z, where this commit is now bffc00f. It ships with 0.6.0. GitHub closes an issue only for a commit onmain, so the feature-train role (TALE-239) closes it.feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory
feat(sandbox): warn when the session limit exceeds the host's memory