From 35124e4252de5e9543a366aba007bbb48452d3da Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Thu, 29 Oct 2026 15:00:05 -0700 Subject: [PATCH] fix(agent-awake): release macOS sleep assertions when Orca exits (#35649) Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> --- src/main/macos-system-sleep-assertion.test.ts | 12 ++++++++---- src/main/macos-system-sleep-assertion.ts | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/macos-system-sleep-assertion.test.ts b/src/main/macos-system-sleep-assertion.test.ts index de6544f2dd5..47d33f422c2 100644 --- a/src/main/macos-system-sleep-assertion.test.ts +++ b/src/main/macos-system-sleep-assertion.test.ts @@ -32,10 +32,14 @@ describe('MacosSystemSleepAssertion', () => { assertion.start('status-change') - expect(spawn).toHaveBeenCalledWith('/usr/bin/caffeinate', ['-i', '-s'], { - stdio: 'ignore', - windowsHide: true - }) + expect(spawn).toHaveBeenCalledWith( + '/usr/bin/caffeinate', + ['-i', '-s', '-w', String(process.pid)], + { + stdio: 'ignore', + windowsHide: true + } + ) }) it('is a no-op off macOS', () => { diff --git a/src/main/macos-system-sleep-assertion.ts b/src/main/macos-system-sleep-assertion.ts index 1612df813e2..36e5d521a8a 100644 --- a/src/main/macos-system-sleep-assertion.ts +++ b/src/main/macos-system-sleep-assertion.ts @@ -71,7 +71,7 @@ export class MacosSystemSleepAssertion { let child: CaffeinateProcess try { - child = this.spawn('/usr/bin/caffeinate', ['-i', '-s'], { + child = this.spawn('/usr/bin/caffeinate', ['-i', '-s', '-w', String(process.pid)], { stdio: 'ignore', windowsHide: true })