pr-review snapshot directory leaks on early termination #1217

Closed
opened 2026-10-27 13:39:29 +00:00 by sam · 0 comments
Owner

stagePRAnatomy materializes the PR snapshot via os.MkdirTemp under the OS temp dir and stores the path on tc.prReview.snapshotDir; only stagePROutput's happy path (implicitly, by the workflow reaching its end) has any chance to clean it up, and no stage currently calls os.RemoveAll on it at all. If any stage from anatomy onward returns an error (parking the task), the snapshot directory is never removed. Needs either an explicit cleanup stage guaranteed to run regardless of where the pipeline stops, or a park/finish hook in the engine that can defer cleanup registered by a stage. Scoped out of archie-core-afbk.3 since it needed a decision about whether workflow.Run should grow a general per-run cleanup hook (an engine change) versus a narrower pr-review-specific fix.

Close reason

Shared snapshot cleanup c04874c5


Imported from beads archie-core-adtp · GitHub #1350 · type bug · priority P2 · created 2026-09-27 · closed 2026-10-17

stagePRAnatomy materializes the PR snapshot via os.MkdirTemp under the OS temp dir and stores the path on tc.prReview.snapshotDir; only stagePROutput's happy path (implicitly, by the workflow reaching its end) has any chance to clean it up, and no stage currently calls os.RemoveAll on it at all. If any stage from anatomy onward returns an error (parking the task), the snapshot directory is never removed. Needs either an explicit cleanup stage guaranteed to run regardless of where the pipeline stops, or a park/finish hook in the engine that can defer cleanup registered by a stage. Scoped out of archie-core-afbk.3 since it needed a decision about whether workflow.Run should grow a general per-run cleanup hook (an engine change) versus a narrower pr-review-specific fix. ### Close reason Shared snapshot cleanup c04874c5 --- _Imported from beads `archie-core-adtp` · GitHub #1350 · type bug · priority P2 · created 2026-09-27 · closed 2026-10-17_
sam added the mediumbug labels 2026-10-27 13:39:29 +00:00
sam self-assigned this 2026-10-27 13:39:29 +00:00
sam closed this issue 2026-10-27 13:39:29 +00:00
sam added the task label 2026-11-14 14:45:21 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1217