fix(macos): scope deferred daemon retirement

This commit is contained in:
Brennan Benson
2026-08-14 19:25:19 -07:00
parent 4b4c2fa213
commit c420f73cf4
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -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 () => {
+2 -2
View File
@@ -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<RestartDaemonResult> {
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