Repository navigation
Description
Summary
Tale deletes a project agent's workspace only while it is idle: the sandbox_workspaces policy weighs a workspace for its size or for disk space once no run used it for reclaimMinIdleHours (24 by default), and deletes an unused one after unusedDays. A worker that runs every hour is never idle, so it keeps every checkout its runs ever made. On a busy install the session disk fills with checkouts of finished tasks until it reaches its free-space floor, and then every new session waits.
Evidence (agents.tale.dev, v0.5.94, 2026-11-01)
One Development project: a Coder pool of 4 workers on tale-project/tale, one Reviewer, one Lead.
- The session disk (
/var/lib/tale-sandbox/sessions, 1.3 TB) held 1,005 GiB in 133 workspaces after three days. - Four busy Coder workers held 103 to 133 GiB each, the Reviewer's four 23 to 48 GiB. The Coder's first worker kept 35 checkouts of
tale-project/taleat 4.3 to 5.4 GB each: rootnode_modules1.7 GB, the workspaces' ownnode_modulesand build output 1.3 GB,.turbo0.6 GB,.git0.4 GB. The agents work both in clones and ingit worktreecheckouts of one clone. - At about 08:40 UTC the spawner logged
the session disk (/var/lib/tale-sandbox/sessions) has 99.9 GiB free, below its 100.0 GiB floor: new sessions wait until some is freed (SANDBOX_MIN_FREE_DISK), and a Reviewer run reported its host leases refused for disk at the same time. reclaimOnDiskPressureandmaxWorkspaceGiBcannot help: both take idle workspaces only, and these were in use every hour. (SettingmaxWorkspaceGiBdid reclaim the idle workers left from an earlier, larger pool.)
Stopgap on that install
An hourly host timer runs a short script inside each running worker, as the agent's own user, so no path a run wrote can lead it outside the sandbox. The script removes the checkouts in /agent/workspace that no git command touched for 24 hours (worktrees with git worktree remove --force), keeps a clone that holds commits no remote has for a week, and never touches the checkout of a task a run in that worker works on. One trap: a worktree's reflog and admin directory are no sign of use, because a git gc in the repository the worktrees share rewrites every worktree's reflog at once.
Options
- Task-scoped directories. Each run gets a working directory for its task (for example
/agent/tasks/<task id>, also named in an environment variable). The platform deletes that directory in every workspace of the agent when the task closes (Done or Cancelled), and after a number of days for a task that stays open. - Reclaim inside a busy workspace. Between two runs of a worker, the platform deletes the workspace's top-level entries that no run used for
reclaimMinIdleHours. It needs a sign of use that agit gcdoes not refresh. - Tell the agent. The harness's instructions say that the workspace outlives the run, and that a run removes the checkouts of tasks that have closed.
Related
- Decision: bound how much disk one sandbox workspace may use on Docker (there is no per-session quota) #4871: bounding how much disk one session may write (no per-session quota on Docker). That issue is about one session writing too much; this one is about a busy agent that never releases what its finished tasks left behind.
Activity
fix(platform): delete closed tasks' directories from a busy worker
fix(platform): stop exporting the task directories root
fix(platform): stop exporting the task directories root
docs: write the v0.5.96 release notes
docs: write the v0.5.96 release notes