Skip to content

feat: extract restart operation to core/operations/restart.ts#95

Open
2witstudios wants to merge 3 commits into
mainfrom
ppg/issue-60-restart-op
Open

feat: extract restart operation to core/operations/restart.ts#95
2witstudios wants to merge 3 commits into
mainfrom
ppg/issue-60-restart-op

Conversation

@2witstudios

Copy link
Copy Markdown
Owner

Summary

  • Extracted restart business logic from commands/restart.ts into core/operations/restart.ts with a reusable performRestart() function
  • Simplified commands/restart.ts to a thin CLI wrapper (arg parsing + output formatting)
  • Added 8 tests covering: tmux window creation, manifest updates (new agent added, old agent marked gone), old agent cleanup, prompt override, error cases

Test plan

  • npm run typecheck passes (no new errors)
  • npm test — all 201 tests pass (8 new), pre-existing cron-parser failures unchanged
  • JSON output shape unchanged for backwards compatibility

Closes #60

Move agent restart logic from commands/restart.ts into a reusable
performRestart() function in core/operations/restart.ts. The CLI
command is now a thin wrapper handling arg parsing and output formatting.

Closes #60
@chatgpt-codex-connector

Copy link
Copy Markdown

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

coderabbitai Bot commented Feb 27, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@2witstudios has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 59 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 8087a17.

📒 Files selected for processing (5)
  • src/commands/restart.ts
  • src/commands/spawn.test.ts
  • src/core/operations/restart.test.ts
  • src/core/operations/restart.ts
  • src/lib/errors.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-60-restart-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.

- Add PromptNotFoundError to error hierarchy (P1: undocumented error code)
- Add killedOldAgent flag to RestartResult so command logs kill feedback (P2)
- Accept optional projectRoot param for programmatic/conductor use (P2)
- Refactor tests: setupDefaults accepts status override, remove duplication (P2)
- Add tests for exited/gone agent skip-kill behavior (P3)
- Add spawnAgent args assertion test (P3)
- Test count: 8 → 14
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 restart operation to core/operations/restart.ts

1 participant