Skip to content

fix: prevent zombie instances on macOS app restart#23763

Merged
Jasonnnz merged 2 commits into
mainfrom
feature/fix-restart-zombie
Apr 6, 2026
Merged

fix: prevent zombie instances on macOS app restart#23763
Jasonnnz merged 2 commits into
mainfrom
feature/fix-restart-zombie

Conversation

@Jasonnnz
Copy link
Copy Markdown
Contributor

@Jasonnnz Jasonnnz commented Apr 6, 2026

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

  • Disconnect connectionManager before vellumCli.stop() in performRestart() to prevent auto-wake from fighting with shutdown
  • Add isRestarting flag so applicationShouldTerminate returns .terminateNow when restarting (skips redundant second cli.stop() and fragile async reply dispatch)
  • Reset isRestarting and reconnect connectionManager on relaunch failure so the app doesn't stay in a disconnected state

Milestone PRs (merged into feature branch)

Project issue

Closes #23755

Test plan

  • Click "Restart" from menu bar — verify only one app instance remains
  • Click "Restart" multiple times — verify no compounding instances
  • Simulate relaunch failure (e.g., corrupt bundle path) — verify app stays functional and connected
  • Normal Cmd+Q quit — verify daemon is properly stopped (unaffected by changes)

Open with Devin

* 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>
@Jasonnnz Jasonnnz self-assigned this Apr 6, 2026
@Jasonnnz
Copy link
Copy Markdown
Contributor Author

Jasonnnz commented Apr 6, 2026

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

…ateNow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Jasonnnz
Copy link
Copy Markdown
Contributor Author

Jasonnnz commented Apr 6, 2026

@codex review this PR again — the previous issues have been fixed in commit 2e12cd1

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ 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".

@Jasonnnz Jasonnnz merged commit a5b529a into main Apr 6, 2026
6 checks passed
@Jasonnnz Jasonnnz deleted the feature/fix-restart-zombie branch April 6, 2026 15:51
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.

Fix performRestart() zombie instances on macOS

1 participant