You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sandbox: an agent session that fails after its container was created leaves the container behind #3494
When createOrAcquireSession fails for a new agent session, the catch in agent_session.ts
marks the app.sandbox_sessions row failed and rethrows. It does not ask the spawner to
destroy what it may already have created. If the spawner had created the session container before
the failure, that container stays in Docker state created (never started) with no owner that
will ever remove it:
the watchdog's reconcile pass only probes creating, active and degraded rows
(watchdogs.ts),
so a failed row is never reconciled and its destroyed_at_ms stays empty;
the spawner's idle reaper does not collect a container that never started.
Observed (self-hosted, 2026-09-24 to 2026-09-26)
A workflow agent session was provisioned while the host's Tale runtime was being upgraded. Four
attempts within 50 seconds all ended failed; the first one's container
(tale-sbx-ses-wf-…, labels tale.sandbox-session=1, tale.profile=agent) was created
at the same millisecond as its row and was still in state created two days later, after the
workflow run itself had completed successfully.
Why it matters
The container names the tale-sandbox-runtime image of the release that was running then. Any
image reclaim that keeps images a container still refers to therefore keeps that image and, when
it keeps whole releases, the entire superseded release: on the affected host one leaked container
held back about 12.5 GB (eight images) through every later deploy, and the host reached 88 % disk
use. Its session directory under /var/lib/tale-sandbox/sessions/ also stays.
Suggested fix
On the failure path, make a best-effort spawner-side destroy of the session (container and
workspace) before marking the row failed, logging rather than throwing if that destroy fails.
And/or let the reconcile or reclaim pass pick up failed rows whose destroyed_at_ms is
empty, so leftovers from a failure that raced the destroy are still collected.
Activity