From 5547386cb727d10d932049205ba18783fcd05db7 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Sun, 16 Aug 2026 19:16:07 -0700 Subject: [PATCH] fix(terminal): keep inventory host inference typed --- src/main/runtime/orca-runtime.ts | 6 +++++- src/main/runtime/terminal-list-execution-host-scope.test.ts | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) 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),