feat(taskactions): archive reaps the task's worktree; cleanup test models a completed run

A worktree terminal cleanup keeps (uncaptured or unreadable work) now has a
reap path: archiving calls Daemon.RemoveWorktree for the owning identity's
trees, and the keep logs name archive as the way out. The no-change cleanup
test reports completed through one direct transition instead of reaching
merged via a faked pr_open hop.
This commit is contained in:
sam committed 2026-09-27 13:38:12 +10:00
1 parent 061816ac22
commit 2ba8bb35bb
6 files changed
+73 -29

No files matched your search

+10 -2
View File
@@ -140,8 +140,11 @@ type Service struct {
CancelTask func(int64) bool
CloseIssue func(context.Context, string, string, int, string) error
RemoveLogs func(int64) error
Publish func(events.Event)
Warn func(string, ...any)
// RemoveWorktree discards the task's clone on archive, the reap path for a
// worktree terminal cleanup kept because it may hold uncaptured work.
RemoveWorktree func(*Task) error
Publish func(events.Event)
Warn func(string, ...any)
}
// Apply scopes chat requests to an identity. A nil scope denotes a caller
@@ -315,6 +318,11 @@ func (s Service) applyArchive(ctx context.Context, task *Task, actor Actor, o ou
s.warn("task log cleanup failed", "task", task.ID, "err", cleanupErr)
}
}
if s.RemoveWorktree != nil {
if cleanupErr := s.RemoveWorktree(task); cleanupErr != nil {
s.warn("task worktree cleanup failed", "task", task.ID, "err", cleanupErr)
}
}
return o, nil
}