mirror of
https://github.com/stablyai/orca.git
synced 2026-10-20 08:03:28 +00:00
Move managed agent-hook filesystem work behind one relay RPC so high-latency SSH connects pay one WAN round trip instead of hundreds. Keep installers serial, lock shared account config across relay processes, and fence cancelled connection generations from replacement state. Co-authored-by: nasagong <zinho2000@gachon.ac.kr> Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
23 lines
766 B
TypeScript
23 lines
766 B
TypeScript
import { afterEach, describe, expect, it, vi } from 'vitest'
|
|
import { resolveRelayGrokHome } from './managed-hook-runtime'
|
|
|
|
afterEach(() => {
|
|
vi.unstubAllEnvs()
|
|
})
|
|
|
|
describe.runIf(process.platform !== 'win32')('resolveRelayGrokHome', () => {
|
|
it('uses the login-shell GROK_HOME and normalizes trailing separators', async () => {
|
|
vi.stubEnv('SHELL', '/bin/sh')
|
|
vi.stubEnv('GROK_HOME', '/srv/grok///')
|
|
|
|
await expect(resolveRelayGrokHome('/home/orca')).resolves.toBe('/srv/grok')
|
|
})
|
|
|
|
it('falls back when the login-shell GROK_HOME is not an absolute POSIX path', async () => {
|
|
vi.stubEnv('SHELL', '/bin/sh')
|
|
vi.stubEnv('GROK_HOME', '../relative')
|
|
|
|
await expect(resolveRelayGrokHome('/home/orca')).resolves.toBe('/home/orca/.grok')
|
|
})
|
|
})
|