fix: prevent zombie instances on macOS app restart#23763
Merged
Conversation
* fix: prevent zombie instances on app restart Disconnect connectionManager before daemon stop in performRestart() to prevent autoWakeIfAssistantDied() from fighting with the shutdown. Add isRestarting flag so applicationShouldTerminate returns .terminateNow, skipping the redundant second cli.stop() and fragile async MainActor.run dispatch that could leave the process as a zombie. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: reset isRestarting flag on relaunch failure Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: reconnect connectionManager on restart relaunch failure Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@codex review |
…ateNow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a bug where clicking "Restart" from the menu bar leaves the old app instance alive as a zombie (with its menu bar icon still visible), compounding with each subsequent restart.
Changes
connectionManagerbeforevellumCli.stop()inperformRestart()to prevent auto-wake from fighting with shutdownisRestartingflag soapplicationShouldTerminatereturns.terminateNowwhen restarting (skips redundant secondcli.stop()and fragile async reply dispatch)isRestartingand reconnectconnectionManageron relaunch failure so the app doesn't stay in a disconnected stateMilestone PRs (merged into feature branch)
Project issue
Closes #23755
Test plan