Skip to content

fix: skip force-kill logging when no processes remain - #616

Merged
gustavohenke merged 1 commit into
open-cli-tools:mainfrom
imshunsuke:fix/skip-empty-force-kill-log
Sep 4, 2026
Merged

gustavohenke merged 1 commit into
open-cli-tools:mainfrom
imshunsuke:fix/skip-empty-force-kill-log

Conversation

@imshunsuke

Copy link
Copy Markdown
Contributor

Summary

  • avoid logging a force-kill event when no processes remain killable
  • cover processes that exit after the initial termination signal

Problem

When killTimeout is enabled, a process may exit normally after receiving the initial termination signal. The timeout callback currently treats the resulting empty command array as truthy and logs Sending SIGKILL to 0 processes.., even though no force kill occurs.

Fix

Only log and send SIGKILL when the timeout callback finds at least one process that is still killable.

Testing

  • pnpm vitest run --project unit lib/flow-control/kill-others.spec.ts
  • CI=1 pnpm test
  • pnpm exec vitest --coverage
  • pnpm typecheck
  • pnpm lint
  • pnpm format
  • pnpm build
  • pnpm test:smoke

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 98.83% (+0.07%) from 98.757% — imshunsuke:fix/skip-empty-force-kill-log into open-cli-tools:main

@gustavohenke gustavohenke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, nice catch, LGTM

@gustavohenke
gustavohenke merged commit 13bdff1 into open-cli-tools:main Sep 4, 2026
21 checks passed
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.

3 participants