You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(knowledge): clean up video-digest temp dirs when a watch is interrupted by a signal #6920
run-watch.js removes a failed watch's temp directories in a finally block, which does not run when the process is killed by SIGINT or SIGTERM before bootstrap finishes. Raised in review of #6853 (P2, #6853 (comment)) and deferred as beyond that PR's fix.
Failure scenario
Start run-watch.js on a long video.
Press Ctrl+C during download.
Expected: the temp video and frame directories are removed.
Actual: they remain in the OS temp directory.
Suggested fix
Register SIGINT and SIGTERM handlers that run the same cleanup, then exit with the conventional signal code; cover with a test that sends the signal to a child run.
Thanks for the report. I understand the issue: run-watch.js creates temp directories for the video, frames, and sheets via mkdtemp, and the cleanup that removes them runs in a finally block that never executes if the process is killed by SIGINT/SIGTERM before bootstrap finishes (e.g. Ctrl+C during download), leaving the temp directories behind. The suggested fix of adding SIGINT/SIGTERM handlers that run the same cleanup before exiting, with a test that signals a child run, sounds reasonable. I didn't find any existing open issue tracking this specifically; it looks related to the review discussion on #6853 and to #6833 as you noted. No further information is needed from you to act on this.
Owner batch-ratified this admission in an attended session on 2026-10-12: work-class: scoped. Rule: class C1-C3, no trust surface, the independent check confirmed the recorded decision, and no owner step remains.
Type: Bug Summary: Remove a video-digest watch's temp directories when the run is interrupted by SIGINT or SIGTERM.
Current behavior:
The watch runner removes its temp video, frame and sheet directories in a finally block, which does not run when the process is killed by a signal before bootstrap finishes, so the directories stay in the OS temp directory.
Desired behavior:
On SIGINT or SIGTERM the runner runs the same cleanup, then exits with the conventional signal exit code (130 for SIGINT, 143 for SIGTERM). Cleanup runs once even if the finally path also fires. Handlers are removed once the run finishes normally.
Key interfaces:
The watch runner's temp-directory cleanup: callable from both the finally path and the signal handlers.
Acceptance criteria:
A test starts a child run, sends it SIGTERM before it finishes, and finds its temp directories removed and its exit code 143.
The work-resolve-issue run that agent-ready started failed before it reported, or the token broker refused it because its workflow files differ from main's. work-unblock removed and added agent-ready back to start a fresh run on main's workflow files. It does this once per version of those files, so if this run fails the same way, a person looks at it.
Activity
github-actions commentedon Oct 11, 2026
Thanks for the report. I understand the issue:
run-watch.jscreates temp directories for the video, frames, and sheets viamkdtemp, and the cleanup that removes them runs in afinallyblock that never executes if the process is killed by SIGINT/SIGTERM before bootstrap finishes (e.g. Ctrl+C during download), leaving the temp directories behind. The suggested fix of adding SIGINT/SIGTERM handlers that run the same cleanup before exiting, with a test that signals a child run, sounds reasonable. I didn't find any existing open issue tracking this specifically; it looks related to the review discussion on #6853 and to #6833 as you noted. No further information is needed from you to act on this.Automated triage. A maintainer reviews it.
kyle-sexton commentedon Oct 13, 2026
Owner batch-ratified this admission in an attended session on 2026-10-12: work-class: scoped. Rule: class C1-C3, no trust surface, the independent check confirmed the recorded decision, and no owner step remains.
kyle-sexton commentedon Oct 18, 2026
Agent Brief
Type: Bug
Summary: Remove a video-digest watch's temp directories when the run is interrupted by SIGINT or SIGTERM.
Current behavior:
The watch runner removes its temp video, frame and sheet directories in a
finallyblock, which does not run when the process is killed by a signal before bootstrap finishes, so the directories stay in the OS temp directory.Desired behavior:
On SIGINT or SIGTERM the runner runs the same cleanup, then exits with the conventional signal exit code (130 for SIGINT, 143 for SIGTERM). Cleanup runs once even if the
finallypath also fires. Handlers are removed once the run finishes normally.Key interfaces:
finallypath and the signal handlers.Acceptance criteria:
scripts/run-test-file.shpasses on the test file.scripts/check-changelog-fragments.shpasses.Out of scope:
This was generated by AI during backlog shaping. The owner approved this in an attended backlog-shaping session on 2026-10-17.
melodic-automation-lanes commentedon Oct 18, 2026
The work-resolve-issue run that
agent-readystarted failed before it reported, or the token broker refused it because its workflow files differ from main's. work-unblock removed and addedagent-readyback to start a fresh run on main's workflow files. It does this once per version of those files, so if this run fails the same way, a person looks at it.