Skip to content

Stop exited companions’ descendants before restarting - #371

Merged
lydakis merged 1 commit into
mainfrom
codex/companion-exit-cleanup
Oct 29, 2026
Merged

lydakis merged 1 commit into
mainfrom
codex/companion-exit-cleanup

Conversation

@lydakis

@lydakis lydakis commented Oct 29, 2026

Copy link
Copy Markdown
Owner

A companion that exits while its descendants remain alive currently restarts without stopping the old process group. For example, a command that backgrounds a child and exits can accumulate processes across restarts, and those descendants outlive daemon shutdown.

Retain the group ID before reaping the leader and run the existing asynchronous SIGTERM/grace/SIGKILL cleanup before restarting. Explicit removal and shutdown use the same cleanup. This adds no work to socket requests, bot scheduling, or store writes; the existing nonblocking companion lifecycle performs the cleanup.

Validation: a new regression test reproduced the leaked descendant before the fix and passes afterward, alongside the existing companion lifecycle tests on macOS. The full macOS workspace Rust suite, clippy with warnings denied, formatting and diff checks pass using the repository-pinned Rust 1.98.0. The workspace run required scoped escalation after sandboxed Unix socket tests returned Operation not permitted. CI and automated review remain required before merging.

Release recovery for the remaining process-group finding in #370.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T09:43:19.684590Z d4e7db1 PR opened
🔒 Security Review ✅ Completed 2026-10-29T09:43:48.018090Z d4e7db1 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lydakis
lydakis merged commit 67c81cb into main Oct 29, 2026
5 checks passed
@lydakis lydakis mentioned this pull request Oct 29, 2026
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.

1 participant