Isolate agent process groups from Controller - #362
germanescobar wants to merge 1 commit into
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 28b8e8c27c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| process.once("exit", () => { | ||
| stopAllSessionRuntimes(); |
There was a problem hiding this comment.
Clean up isolated agents on termination signals
When Controller is stopped with SIGINT or SIGTERM—such as Ctrl-C in the documented dev flow, whose wrapper forwards both signals in scripts/dev-server-with-port-bump.mjs—Node performs the default signal termination without emitting the exit event, so this callback does not run. Since this commit moves agent CLIs into detached process groups, they no longer receive that terminal/service signal and can continue running tools after Controller exits; install explicit SIGINT/SIGTERM handlers that synchronously stop the runtimes before re-raising the signal or exiting.
Useful? React with 👍 / 👎.
Summary
Why
An agent tool or test runner can signal its entire process group. Agent CLIs previously shared Controller's process group, so one of those signals could terminate the Electron host as well. macOS then recorded a normal process exit rather than a crash, which explains why no crash report was generated.
Verification
npm run buildnpx tsc -p server/tsconfig.json --noEmit