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,25 @@
import type { ProjectExecutionRuntimeResolution } from '../../../shared/project-execution-runtime'
import { isWslUncPath } from '../../../shared/wsl-paths'
import { splitWorktreeIdForFilesystem } from '../../../shared/worktree-id'
export type OrchestrationCliCommand = 'orca' | 'orca-ide'
export function resolveTerminalOrchestrationCliCommand(args: {
connectionId: string | null
isWsl: boolean | null | undefined
worktreeId: string
projectRuntime?: ProjectExecutionRuntimeResolution
}): OrchestrationCliCommand {
if (args.connectionId) {
return 'orca'
}
if (args.isWsl !== null && args.isWsl !== undefined) {
return args.isWsl ? 'orca-ide' : 'orca'
}
if (args.projectRuntime?.status === 'resolved' && args.projectRuntime.runtime.kind === 'wsl') {
return 'orca-ide'
}
const worktreePath = splitWorktreeIdForFilesystem(args.worktreeId)?.worktreePath
return worktreePath && isWslUncPath(worktreePath) ? 'orca-ide' : 'orca'
}