diff --git a/src/main/runtime/orca-runtime.test.ts b/src/main/runtime/orca-runtime.test.ts index f39b284bfc4..2f8f53a0432 100644 --- a/src/main/runtime/orca-runtime.test.ts +++ b/src/main/runtime/orca-runtime.test.ts @@ -180,7 +180,7 @@ const electronMocks = vi.hoisted(() => { BrowserWindow: { fromId: vi.fn((_id: number): unknown => null) }, webContents: { fromId: vi.fn((_id: number): unknown => null) }, ipcMain, - app: { getPath: vi.fn(() => '/tmp') } + app: { getPath: vi.fn(() => '/tmp'), isPackaged: false } } }) @@ -621,6 +621,7 @@ vi.mock('../git/git-username', async () => { function resetRuntimeTestMocks(): void { resetPlatform() + electronMocks.app.isPackaged = false clearConfiguredWorktreeSharedDirectoriesCacheForTests() _resetTerminalViewAttributesForTest() advertisedUrlWatcher.clear() @@ -1719,6 +1720,7 @@ describe('OrcaRuntimeService', () => { }) it('reconciles hooks only when paired-client hook settings change', async () => { + electronMocks.app.isPackaged = true let settings = { ...store.getSettings(), agentStatusHooksEnabled: true, @@ -1742,7 +1744,10 @@ describe('OrcaRuntimeService', () => { expect(applyAgentStatusHooksEnabledMock).toHaveBeenCalledWith( true, expect.objectContaining({ disabledTuiAgents: ['claude'] }), - expect.objectContaining({ shouldContinue: expect.any(Function) }) + expect.objectContaining({ + shouldContinue: expect.any(Function), + shouldHydrateShellPath: process.platform !== 'win32' + }) ) }) diff --git a/src/main/runtime/orca-runtime.ts b/src/main/runtime/orca-runtime.ts index a7c6063ed18..ae9dca63c5b 100644 --- a/src/main/runtime/orca-runtime.ts +++ b/src/main/runtime/orca-runtime.ts @@ -534,7 +534,7 @@ import { } from '../../shared/claude-agent-teams-tmux-compat' import { joinWorktreeRelativePath } from './runtime-relative-paths' import { collectMemorySnapshot } from '../memory/collector' -import { BrowserWindow, ipcMain, Notification } from 'electron' +import { app, BrowserWindow, ipcMain, Notification } from 'electron' import type { AgentBrowserBridge } from '../browser/agent-browser-bridge' import type { BrowserBackend } from '../browser/browser-backend' import { BrowserError } from '../browser/cdp-bridge' @@ -3335,6 +3335,7 @@ export class OrcaRuntimeService { return } await applyAgentStatusHooksEnabled(settings.agentStatusHooksEnabled !== false, settings, { + shouldHydrateShellPath: app.isPackaged && process.platform !== 'win32', onInstallError: recordManagedHookInstallFailure, shouldContinue: (agent) => { const current = this.store?.getSettings()