mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 18:37:24 +00:00
Preserve selected host for WSL-share generation workspaces
This commit is contained in:
@@ -33,7 +33,9 @@ export function runLocalPlanForAgent(input: {
|
||||
}): Promise<InternalTextGenerationResult> {
|
||||
const needsPolicy = ['codex', 'kimi', 'dsh', 'antigravity', 'amp', 'muse'].includes(input.agentId)
|
||||
const wslDistro =
|
||||
wslDistroForCommand(input.target.cwd, input.target.wslDistro) ?? input.target.wslDistro
|
||||
input.plan.promptFile || input.plan.taskFiles?.length || needsPolicy
|
||||
? (wslDistroForCommand(input.target.cwd, input.target.wslDistro) ?? undefined)
|
||||
: input.target.wslDistro
|
||||
const target = {
|
||||
...input.target,
|
||||
wslDistro,
|
||||
|
||||
@@ -140,6 +140,30 @@ it('launches a non-policy agent in the resolved cwd while cancel still targets t
|
||||
child.emit('close', 0)
|
||||
})
|
||||
|
||||
it('keeps a Windows-host generation in a WSL-share workspace on the selected host', async () => {
|
||||
const cwd = '\\\\wsl.localhost\\Ubuntu\\home\\repo'
|
||||
const child = createMockDiscoveryChild()
|
||||
child.stdin.end.mockImplementation(() =>
|
||||
queueMicrotask(() => {
|
||||
child.stdout.emit('data', Buffer.from('Keep the selected Windows host\n'))
|
||||
child.emit('close', 0)
|
||||
})
|
||||
)
|
||||
await expect(
|
||||
runLocalPlanForAgent({
|
||||
agentId: 'claude',
|
||||
plan: planned('claude'),
|
||||
target: { kind: 'local', cwd },
|
||||
operation: 'commit-message',
|
||||
spawnAgent: (input) => {
|
||||
expect(input.cwd).toBe(cwd)
|
||||
expect(input.wslDistro).toBeUndefined()
|
||||
return child
|
||||
}
|
||||
})
|
||||
).resolves.toMatchObject({ success: true, rawOutput: 'Keep the selected Windows host' })
|
||||
})
|
||||
|
||||
it('uses the resolved project for Antigravity policy discovery and the resulting generation', async () => {
|
||||
runWsl.mockResolvedValue(output('/c/repo\n'))
|
||||
const child = createMockDiscoveryChild()
|
||||
|
||||
Reference in New Issue
Block a user