Fix WSL orchestration CLI preambles (#8561)

This commit is contained in:
Jinjing
2026-07-13 05:39:52 -07:00
committed by GitHub
parent 6eda9cdb27
commit 17f032dbd5
13 changed files with 228 additions and 19 deletions
@@ -0,0 +1,59 @@
import { describe, expect, it } from 'vitest'
import { resolveTerminalOrchestrationCliCommand } from './cli-command'
describe('resolveTerminalOrchestrationCliCommand', () => {
it('uses orca-ide for a pane recorded as WSL', () => {
expect(
resolveTerminalOrchestrationCliCommand({
connectionId: null,
isWsl: true,
worktreeId: 'repo::C:\\repo'
})
).toBe('orca-ide')
})
it('uses project runtime and WSL paths when restored pane metadata is unavailable', () => {
expect(
resolveTerminalOrchestrationCliCommand({
connectionId: null,
isWsl: null,
worktreeId: 'repo::C:\\repo',
projectRuntime: {
status: 'resolved',
runtime: {
kind: 'wsl',
hostPlatform: 'wsl',
projectId: 'project',
distro: 'Ubuntu',
reason: 'project-override',
cacheKey: 'project:wsl:Ubuntu'
}
}
})
).toBe('orca-ide')
expect(
resolveTerminalOrchestrationCliCommand({
connectionId: null,
isWsl: null,
worktreeId: 'repo::\\\\wsl.localhost\\Ubuntu\\home\\alice\\repo'
})
).toBe('orca-ide')
})
it('preserves native and SSH bare-orca commands', () => {
expect(
resolveTerminalOrchestrationCliCommand({
connectionId: null,
isWsl: false,
worktreeId: 'repo::/home/alice/repo'
})
).toBe('orca')
expect(
resolveTerminalOrchestrationCliCommand({
connectionId: 'ssh-1',
isWsl: null,
worktreeId: 'repo::\\\\wsl.localhost\\Ubuntu\\home\\alice\\repo'
})
).toBe('orca')
})
})