Files
orca/src/shared/agent-launch-remote.test.ts
T
Neil 43097c517b fix(agents): launch Claude Agent Teams as plain orca on Orca servers (#34116)
* fix(agents): launch Claude Agent Teams as plain orca on Orca servers

A paired Orca server has no SSH connection id, so client launches treated it
as a local Linux desktop and typed `orca-ide claude-teams`. Headless servers
only put `orca` on PATH. Client launches now read the resolved execution host
(SSH or server, except WSL workspaces), and launches built on a headless Linux
server use the launcher that server publishes.

Fixes #33920. Reported by @williamhrs. Client-side approach from #33987 by
@coolwindX; #33975 by @Shubham-Padkonde showed the host-built launch gap.

* fix(orcad): keep orca-ide working for older clients on Linux servers

Older clients type the desktop orca-ide claude-teams into server terminals.
Write an identical orca-ide launcher beside orca. Idea and test from #33975
by @Shubham-Padkonde.
2026-10-26 17:02:51 -07:00

41 lines
1.6 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { repoIsRemote } from './agent-launch-remote'
describe('repoIsRemote', () => {
it('reads both spellings of SSH ownership on two different hosts', () => {
// Distinct SSH hosts catch lookups accidentally reading another row's owner (ssh:m4air to openclaw).
expect(repoIsRemote({ connectionId: 'm4air', executionHostId: null })).toBe(true)
expect(repoIsRemote({ connectionId: null, executionHostId: 'ssh:openclaw' })).toBe(true)
expect(repoIsRemote({ connectionId: 'm4air', executionHostId: 'ssh:m4air' })).toBe(true)
})
it('answers local for a row that declares itself local with a stale connection', () => {
expect(repoIsRemote({ connectionId: 'm4air', executionHostId: 'local' })).toBe(false)
})
it('keeps a runtime host with a nested SSH target remote', () => {
expect(repoIsRemote({ connectionId: 'nested-target', executionHostId: 'runtime:vm-1' })).toBe(
true
)
})
it('treats a headless runtime with no nested SSH target as remote', () => {
expect(repoIsRemote({ connectionId: null, executionHostId: 'runtime:vm-1' })).toBe(true)
})
it('keeps a WSL workspace on a Windows server on the WSL CLI name', () => {
expect(
repoIsRemote({
connectionId: null,
executionHostId: 'runtime:win-1',
path: '\\\\wsl.localhost\\Ubuntu\\home\\u\\repo'
})
).toBe(false)
})
it('keeps plain local rows local', () => {
expect(repoIsRemote({ connectionId: null, executionHostId: null })).toBe(false)
expect(repoIsRemote({ connectionId: null, executionHostId: 'local' })).toBe(false)
})
})