fix(terminal): validate inferred inventory hosts

This commit is contained in:
Brennan Benson
2026-08-16 18:51:07 -07:00
parent 49bec8c560
commit 7ba763480d
2 changed files with 7 additions and 5 deletions
+3 -3
View File
@@ -31328,9 +31328,9 @@ export class OrcaRuntimeService {
}
if (connectionId === undefined) {
for (const process of processes) {
const ssh = parseAppSshPtyId(process.id)
if (ssh) {
hostIds.add(toSshExecutionHostId(ssh.connectionId))
const hostId = getPtyExecutionHost(process.id)
if (hostId !== 'foreign' && parseExecutionHostId(hostId)?.kind === 'ssh') {
hostIds.add(hostId)
}
}
}
@@ -136,9 +136,10 @@ describe('listTerminals execution-host identity', () => {
{ worktreeId: LOCAL_WORKTREE_ID, leafId: REMOTE_LEAF_ID, ptyId: 'remote:handle-1' }
])
const { terminals } = await runtime.listTerminals()
const { hostScope, terminals } = await runtime.listTerminals()
expect(terminals[0]?.executionHostId).toBeUndefined()
expect(hostScope?.hostIds).toEqual(['local'])
})
it.each([
@@ -149,9 +150,10 @@ describe('listTerminals execution-host identity', () => {
])('leaves the host unset for a malformed foreign PTY id: %s', async (ptyId) => {
const runtime = makeRuntime([{ worktreeId: LOCAL_WORKTREE_ID, leafId: REMOTE_LEAF_ID, ptyId }])
const { terminals } = await runtime.listTerminals()
const { hostScope, terminals } = await runtime.listTerminals()
expect(terminals[0]?.executionHostId).toBeUndefined()
expect(hostScope?.hostIds).toEqual(['local'])
})
})