From c420f73cf4aa9a51fd366e3f4f393938cfed372f Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Fri, 14 Aug 2026 19:25:19 -0700 Subject: [PATCH] fix(macos): scope deferred daemon retirement --- src/main/daemon/daemon-init.test.ts | 4 +++- src/main/daemon/daemon-init.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/daemon/daemon-init.test.ts b/src/main/daemon/daemon-init.test.ts index 361ffb76468..2ad8ada30bc 100644 --- a/src/main/daemon/daemon-init.test.ts +++ b/src/main/daemon/daemon-init.test.ts @@ -585,7 +585,9 @@ describe('daemon-init: runRestartDaemon (7-step sequence)', () => { await mod.initDaemonPtyProvider() - expect(adapterInstances[0].options.packagedAppVersion).toBe('1.2.3') + expect(adapterInstances[0].options.packagedAppVersion).toBe( + process.platform === 'darwin' ? '1.2.3' : null + ) }) it('uses daemon-owned idle retirement when a fresh launch fails permanent adoption', async () => { diff --git a/src/main/daemon/daemon-init.ts b/src/main/daemon/daemon-init.ts index 594c201a986..b666043c8f4 100644 --- a/src/main/daemon/daemon-init.ts +++ b/src/main/daemon/daemon-init.ts @@ -962,7 +962,7 @@ export async function initDaemonPtyProvider( pidPath: getDaemonPidPath(runtimeDir), profileScope: runtimeDir, runtimeDir, - packagedAppVersion: app.isPackaged ? app.getVersion() : null, + packagedAppVersion: process.platform === 'darwin' && app.isPackaged ? app.getVersion() : null, historyPath: getHistoryDir(), // Why: on daemon death, ensureConnected() detects the dead socket and calls this to fork a replacement before retrying. respawn: async (reason: DaemonRespawnReason) => { @@ -1198,7 +1198,7 @@ async function runRestartDaemon(): Promise { pidPath: getDaemonPidPath(runtimeDir), profileScope: runtimeDir, runtimeDir, - packagedAppVersion: app.isPackaged ? app.getVersion() : null, + packagedAppVersion: process.platform === 'darwin' && app.isPackaged ? app.getVersion() : null, historyPath: getHistoryDir(), respawn: async (reason: DaemonRespawnReason) => { // Why: attribute rather than emit — the launcher below is the one that completes the