From 06c9730441593c191f968f8041a0e76f56368a39 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Fri, 10 Jul 2026 22:13:49 +0000 Subject: fix(executor): periodically sweep stale dispatch workspace directories ContainerRunner preserves a failed execution's workspace indefinitely for debugging, with no expiry -- this accumulated 161 stale directories (~17.6GB) and took the host to 100% disk full on 2026-07-10. Pool.RunWorkspaceCleanup sweeps claudomator-workspace-* dirs older than 24h every hour, started from serve.go, mirroring StoryOrchestrator.Run's ticker shape. Never removes a directory still referenced as a currently-BLOCKED task's sandbox_dir, regardless of age. --- internal/cli/serve.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal/cli/serve.go') diff --git a/internal/cli/serve.go b/internal/cli/serve.go index 393b6bc..4054a3b 100644 --- a/internal/cli/serve.go +++ b/internal/cli/serve.go @@ -283,6 +283,12 @@ func serve(addr, basePath string) error { } go storyOrch.Run(ctx, scheduler.DefaultStoryPollInterval) + // Sweep stale dispatch workspace directories (internal/executor.Pool's + // RunWorkspaceCleanup) — ContainerRunner preserves a failed execution's + // workspace indefinitely for debugging with no expiry of its own, which + // otherwise accumulates forever. See that function's doc comment. + go pool.RunWorkspaceCleanup(ctx, executor.DefaultWorkspaceCleanupInterval, executor.DefaultWorkspaceCleanupMaxAge) + httpSrv := &http.Server{ Addr: addr, Handler: srv.Handler(), -- cgit v1.2.3