mirror of
https://github.com/stablyai/orca.git
synced 2026-10-19 16:03:26 +00:00
fix(agent-hooks): hydrate PATH for paired clients
This commit is contained in:
@@ -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'
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user