diff --git a/src/main/runtime/orca-runtime.ts b/src/main/runtime/orca-runtime.ts index 00b707b9d5d..8dc377053f3 100644 --- a/src/main/runtime/orca-runtime.ts +++ b/src/main/runtime/orca-runtime.ts @@ -31333,7 +31333,11 @@ export class OrcaRuntimeService { if (connectionId === undefined) { for (const process of processes) { const hostId = getPtyExecutionHost(process.id) - if (hostId !== 'foreign' && parseExecutionHostId(hostId)?.kind === 'ssh') { + if ( + hostId && + hostId !== 'foreign' && + parseExecutionHostId(hostId)?.kind === 'ssh' + ) { hostIds.add(hostId) } } diff --git a/src/main/runtime/terminal-list-execution-host-scope.test.ts b/src/main/runtime/terminal-list-execution-host-scope.test.ts index 0fae9976bba..edf8b64370e 100644 --- a/src/main/runtime/terminal-list-execution-host-scope.test.ts +++ b/src/main/runtime/terminal-list-execution-host-scope.test.ts @@ -3,6 +3,7 @@ import { OrcaRuntimeService } from './orca-runtime' import { getDefaultWorkspaceSession } from '../../shared/constants' import type { WorkspaceSessionState } from '../../shared/workspace-session-state-types' import { folderWorkspaceKey } from '../../shared/workspace-scope' +import type { FolderWorkspace } from '../../shared/folder-workspace-types' // An agent once declared a task exited because `terminal list` came back without // its worker: the worker was live on an SSH host, and nothing in the response @@ -37,7 +38,7 @@ function makeStore() { return { getWorkspaceSession: vi.fn(() => session), getWorkspaceSessionHostIds: vi.fn(() => ['local', 'ssh:box-1']), - getFolderWorkspaces: vi.fn(() => []), + getFolderWorkspaces: vi.fn((): FolderWorkspace[] => []), getProjectGroups: vi.fn(() => []), setWorkspaceSession: vi.fn(), getRepos: vi.fn(() => REPOS),