mirror of
https://github.com/stablyai/orca.git
synced 2026-10-25 08:04:05 +00:00
fix(terminal): validate inferred inventory hosts
This commit is contained in:
@@ -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'])
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user