Repository navigation
Remove a terminal task's dind + config volumes once its container exits - #438
Merged
Merged
Conversation
A docker_in_docker task's `panopticon-dind-<id>` volume holds the nested daemon's whole image store (30-60GB), and nothing ever removed it: the host had 1TB of them orphaned. The host daemon's pass now runs a `sweep` after `cleanup`: a terminal task with no running container has its stopped container removed (it would pin the volumes), then its dind and config volumes removed with `docker volume rm --force`, each independently and best-effort. Swept ids are tracked in-process so docker runs once per task per runner process. Respawns never reach it, so the image cache and session history they rely on survive. The sweep isn't gated on the claim: the agent releases its claim on exit and `cleanup` releases any left, so a claim gate would almost never fire. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tildesrc
marked this pull request as ready for review
November 4, 2026 16:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
docker_in_dockertask'spanopticon-dind-<id>volume holds the nested daemon's whole image store (30–60 GB each), and nothing ever removed it.LocalRunnertears down with a plaindocker rm --force, and nodocker volume rmexists anywhere. On 2026-10-27 the host had 145 orphaned dind volumes (1.0 TB) and its root disk was at 94%. This is the structural fix. The plan is in the task'splan.mdartifact.What changes
LocalRunner.remove_volume(name)runsdocker volume rm --force <name>.--forcemakes an already-gone volume a no-op, but a volume still in use is refused, so real failures raise. Newdind_volume()andconfig_volume()helpers give the volume names a single source, andspawnmounts through them too.Spawner.sweep(task)runs in the host daemon's pass right aftercleanup. When a task is terminal and no container is running for it on this host, it:--rmand a stopped one pins its volumes;tryso a failure on one can't skip the other.It tracks swept ids in-process, so Docker runs once per task per runner process and a restart re-sweeps each task once. It skips shell-workflow tasks, which have no volumes.
Respawns keep their volumes.
heal, snooze wake andRonly ever act on non-terminal tasks, so the image cache and CLI session history they depend on survive.The task memo vs. this PR
The memo suggested gating the sweep on tasks claimed by this runner. I didn't, because the claim is almost always gone by the time a task is terminal and exited: the agent releases it on exit, and
cleanupreleases any that's left. The sweep usescleanup's gate instead (terminal, not running). On a host that never ran the task, the removals are harmless no-ops.Tests cover the emitted command, the sweep's order, gates and failure isolation, that
healnever removes a volume, and that each daemon pass sweeps aftercleanup. AGENTS.md's module map and test notes are updated to match.🤖 Generated with Claude Code