mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 16:03:49 +00:00
fix(ai-vault): keep SSH title ownership local
This commit is contained in:
@@ -290,6 +290,27 @@ describe('runtime-owned SSH AI Vault routing', () => {
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
it('does not resolve titles through another runtime for a locally owned SSH target', async () => {
|
||||
mocks.requestActiveSshAiVaultSessionTitles.mockResolvedValue(null)
|
||||
mocks.getActiveSshAiVaultHostInfo.mockReturnValue({})
|
||||
const findRuntimeOwningSshAiVaultHost = vi.fn()
|
||||
const resolveRuntimeOwnedSshAiVaultSessionTitles = vi.fn()
|
||||
registerAiVaultHandlers({
|
||||
findRuntimeOwningSshAiVaultHost,
|
||||
resolveRuntimeOwnedSshAiVaultSessionTitles
|
||||
})
|
||||
|
||||
await expect(
|
||||
_internals.resolveAiVaultSessionTitles({
|
||||
executionHostScope: 'ssh:dev-box',
|
||||
requests: [{ agent: 'codex', sessionId: 'session-1' }]
|
||||
})
|
||||
).resolves.toEqual({ titles: [] })
|
||||
|
||||
expect(findRuntimeOwningSshAiVaultHost).not.toHaveBeenCalled()
|
||||
expect(resolveRuntimeOwnedSshAiVaultSessionTitles).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
||||
function result(sessions: AiVaultSession[]): AiVaultListResult {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
import type { RuntimeOwnedSshAiVaultHost } from '../ai-vault/runtime-owned-ssh-session-list'
|
||||
import { resolveLocalAiVaultSessionTitles } from '../ai-vault/session-title-resolver'
|
||||
import { parseAiVaultSessionTitlesResult } from '../ai-vault/session-title-result-validation'
|
||||
import { requestActiveSshAiVaultSessionTitles } from './ssh'
|
||||
import { getActiveSshAiVaultHostInfo, requestActiveSshAiVaultSessionTitles } from './ssh'
|
||||
|
||||
export type RuntimeAiVaultSessionTitleResolver = (
|
||||
environmentId: string,
|
||||
@@ -70,6 +70,7 @@ async function resolveSshAiVaultSessionTitles(
|
||||
}
|
||||
if (
|
||||
isRuntimeOwnedSshTargetId(targetId) ||
|
||||
getActiveSshAiVaultHostInfo(targetId) ||
|
||||
!options.findRuntimeOwningSshAiVaultHost ||
|
||||
!options.resolveRuntimeOwnedSsh
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user