Skip to content

feat: extract kill operation to core/operations/kill.ts#105

Open
2witstudios wants to merge 3 commits intomainfrom
ppg/issue-61-kill-op
Open

feat: extract kill operation to core/operations/kill.ts#105
2witstudios wants to merge 3 commits intomainfrom
ppg/issue-61-kill-op

Conversation

@2witstudios
Copy link
Owner

Summary

  • Extracted kill logic from commands/kill.ts into core/operations/kill.ts with a performKill() function
  • commands/kill.ts simplified to arg parsing + output formatting (~90 lines, down from ~335)
  • performKill() returns a structured KillResult object, making it reusable by conductors and other callers
  • 17 tests covering single agent kill, multi-agent worktree kill, kill-all, self-protection, delete mode, and open PR skipping

Test plan

  • npm run typecheck passes (pre-existing errors only)
  • npm test — all 210 tests pass (pre-existing cron-parser failures only)
  • New kill.test.ts — 17 tests all passing

Closes #61

Move agent kill logic from commands/kill.ts into a reusable
core/operations/kill.ts module. The CLI command is now a thin
wrapper that handles arg parsing and output formatting, delegating
all kill logic to performKill().

Closes #61
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link

coderabbitai bot commented Feb 27, 2026

Warning

Rate limit exceeded

@2witstudios has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 45 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 34deb69 and 76bd873.

📒 Files selected for processing (4)
  • src/commands/kill.ts
  • src/commands/spawn.test.ts
  • src/core/operations/kill.test.ts
  • src/core/operations/kill.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ppg/issue-61-kill-op

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- P1: Remove unused listSessionPanes import
- P2: Add success field to KillResult; return success:false for
  self-protection (restores original JSON contract)
- P2: Restore info("Killing agent X") progress messages in command layer
- P2: Replace fragile vi.restoreAllMocks with vi.clearAllMocks +
  explicit mock defaults in beforeEach
- P3: Add worktreeCount to KillResult for kill-all message context
- P3: Fix 0-killed message when all agents skipped in worktree kill
- P3: Add manifest mutation verification tests (status=gone, delete)
- P3: Add --remove on --all test and error propagation test
- P3: Fix --all open PR skip warning in command output
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.

Extract kill operation to core/operations/kill.ts

1 participant