Skip to content

bug(platform): a busy agent's workspace keeps a checkout per task until new sessions wait at the disk floor #5255

Closed

Description

@yannickmonney

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/tale at 4.3 to 5.4 GB each: root node_modules 1.7 GB, the workspaces' own node_modules and build output 1.3 GB, .turbo 0.6 GB, .git 0.4 GB. The agents work both in clones and in git worktree checkouts 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.
  • reclaimOnDiskPressure and maxWorkspaceGiB cannot help: both take idle workspaces only, and these were in use every hour. (Setting maxWorkspaceGiB did 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

  1. 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.
  2. 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 a git gc does not refresh.
  3. 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

Activity

  1. added
    bug
    service: platform
    agent-ready
    on Nov 1, 2026
  2. added a commit that references this issue on Nov 1, 2026
    4a76ee9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions