Skip to content

fix(knowledge): stop a detached video-digest repo clone when the parent exits abnormally - #8064

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-6923-39102023088-1
Oct 19, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-6923-39102023088-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #6923

Summary

Opened by the work-resolve-issue lane. The run's own summary:

The harvested-repo clone runner now tracks each live detached clone process group and kills them on parent exit, SIGINT, SIGTERM and SIGHUP. Signal handlers kill the groups, drop themselves and re-raise the signal, so the parent still dies the conventional way and no process.exit is added.

Not verified

  • Fragment written by hand because new-changelog-fragment refuses a detached HEAD; it passes check-changelog-fragments
  • Signal exit now re-raises the signal (death by signal) rather than exit code 128+n, because an existing test forbids process.exit( in this file
  • SIGKILL of the parent and temp-dir cleanup on signal (#6920) are out of scope

Fix

  • plugins/knowledge/skills/video-digest/extraction/harvesting/analyze-harvested-repos.js: track/untrack POSIX clone groups, exit and signal handlers installed only while a clone is live, liveCloneGroupCount export
  • plugins/knowledge/skills/video-digest/extraction/harvesting/analyze-harvested-repos.test.js: tests for normal-finish untracking and for SIGTERM/SIGINT to a parent killing the clone group
  • .changes/knowledge/fix-video-digest-clone-group-parent-exit-3f9a1c2e.md: patch changelog fragment

Verification

The run reports:

Left out: the items under Not verified.

Related

#6923

…nt exits abnormally

Track live clone process groups and kill them on exit, SIGINT, SIGTERM and SIGHUP.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed d22b672dfa7351547fc963222b84b23fe7ecbc8e: 0 finding(s), 0 as inline comments.

No security findings. The incremental change since 812f657 adds one JSDoc @type comment in analyze-harvested-repos.js, typing signalListeners as Array<[NodeJS.Signals, () => void]>. Comments don't run, so the signal handling, process control and trust boundaries are unchanged. I did not re-review the other files in this PR, which were reviewed at the earlier SHA.

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed d22b672dfa7351547fc963222b84b23fe7ecbc8e: 0 finding(s), 0 as inline comments.

Incremental review of d22b672 against 812f657: no findings.

The only change is a JSDoc @type {Array<[NodeJS.Signals, () => void]>} on signalListeners in analyze-harvested-repos.js:125. It has no runtime effect.

I read the surrounding code and the PR context but ran no typecheck or tests. By inspection, the annotation matches the data. HANDLED_SIGNALS is a const tuple of "SIGHUP" | "SIGINT" | "SIGTERM", each of which is a NodeJS.Signals. The two consumers, process.on(signal, listener) and process.off(signal, listener) in the for (const [signal, listener] of signalListeners) loops, take a [signal, listener] pair, and the tuple type gives them one.

The rest of the PR is unchanged since the last review at 812f657.

tsc --noEmit failed in test-node: HANDLED_SIGNALS.map inferred an array of
(signal | listener) unions, so process.on/off rejected the pairs. Annotate
signalListeners as [NodeJS.Signals, () => void] tuples; runtime is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path enqueued this pull request at head d22b672dfa7351547fc963222b84b23fe7ecbc8e.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit 1333298 Oct 19, 2026
17 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-6923-39102023088-1 branch October 19, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(knowledge): stop a detached video-digest repo clone when the parent exits abnormally

1 participant