Skip to content

fix(alias): exit when the parent process goes away instead of lingering as an orphan - #50

Merged
Mearman merged 1 commit into
mainfrom
fix/alias-worker-orphan
Sep 20, 2026
Merged

Mearman merged 1 commit into
mainfrom
fix/alias-worker-orphan

Conversation

@Mearman

@Mearman Mearman commented Sep 20, 2026

Copy link
Copy Markdown
Member

Found in a two-machine test of agent-comms with a real Claude Code session: a reply alias worker outlived the process that had forked it (the old coordinator had been killed, so no stop command was ever sent). It stayed registered under its correspondent's name, so when the front was restarted and created a fresh alias with the same name, the session saw two peers with that name and replied to the orphan. The orphan then tried to relay the reply to a parent that no longer existed, hit an unhandled channel-closed error and dropped it.

The worker now stops its peer and exits when the IPC channel closes, which also removes its registry entry, and only relays to the parent while the channel is open. The new integration test forks the real worker, starts it, closes its channel and checks that it exits cleanly and its registry entry is gone. It times out against the old worker.

…ng as an orphan

An alias worker's only link to its parent is the IPC channel the parent forked it over. When the
parent died without stopping it, which any crash or kill does, the channel closed and nothing
ended the worker: it stayed registered under its correspondent's name, so a session replying to
that name could reach the orphan rather than the live alias, and the orphan's next relay raised
an unhandled channel-closed error and dropped the reply.

The worker now stops its peer, removing its registry entry, and exits when the channel closes,
and only relays to the parent while the channel is open.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 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
🔒 Security Review ✅ Completed 2026-09-20T19:24:45.099241Z 908e6bb 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.

@Mearman
Mearman merged commit 6b0b238 into main Sep 20, 2026
9 checks passed
@Mearman
Mearman deleted the fix/alias-worker-orphan branch September 20, 2026 19:30
@exadev

exadev Bot commented Sep 20, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@exadev exadev Bot added the released label Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant