mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
refactor: give native chat readability one concrete owner (#35231)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { isNativeChatTranscriptLocalReadable } from './native-chat-transcript-readability'
|
||||
|
||||
describe('native chat transcript readability', () => {
|
||||
it('allows local and runtime-owned hosts but rejects Model-A SSH and unresolved hosts', () => {
|
||||
expect(isNativeChatTranscriptLocalReadable(null)).toBe(true)
|
||||
expect(isNativeChatTranscriptLocalReadable('runtime-ssh-env-1')).toBe(true)
|
||||
expect(isNativeChatTranscriptLocalReadable('ssh-target-1')).toBe(false)
|
||||
expect(isNativeChatTranscriptLocalReadable(undefined)).toBe(false)
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,8 @@
|
||||
import { isRuntimeOwnedSshTargetId } from '../../execution-host'
|
||||
|
||||
/** Model-A SSH stores Grok transcripts on a host this renderer cannot read. */
|
||||
export function isNativeChatTranscriptLocalReadable(
|
||||
connectionId: string | null | undefined
|
||||
): boolean {
|
||||
return connectionId === null || isRuntimeOwnedSshTargetId(connectionId)
|
||||
}
|
||||
Reference in New Issue
Block a user