mirror of
https://github.com/stablyai/orca.git
synced 2026-11-03 10:37:35 +00:00
fix(wsl): a missing host gh or glab never boots a stopped default distro (#35709)
Cwd-less gh/glab calls whose host CLI is missing fell back to the default WSL distro with no running check, so background work (rate limits, auth status, Settings, task-source probes) booted a stopped distro. The fallback now asks the background exec gate first: stopped or unverifiable refuses with the distro-stopped error, running and user acts fall back as before.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type * as BackgroundDistroGate from '../../../wsl-background-distro-gate'
|
||||
import {
|
||||
fakeSpawnDispatch,
|
||||
createFakeSpawnedChild
|
||||
@@ -9,6 +10,12 @@ import { startCheckJobLogDownload } from './check-job-log-download'
|
||||
import { prCheckLogTailCache } from './check-job-log-tails'
|
||||
import { setDefaultWslDistroOverride } from '../../../git/runner'
|
||||
const { spawnMock, distroMock } = vi.hoisted(() => ({ spawnMock: vi.fn(), distroMock: vi.fn() }))
|
||||
// The default-distro fallback asks whether the distro runs before it may start it (E9).
|
||||
vi.mock('../../../wsl-background-distro-gate', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof BackgroundDistroGate>()),
|
||||
readWslDistroRunningState: vi.fn(async () => 'running')
|
||||
}))
|
||||
|
||||
vi.mock('node:child_process', async (original) => ({ ...(await original()), spawn: spawnMock }))
|
||||
vi.mock('../../../wsl', async (original) => ({
|
||||
...(await original<typeof WslModule>()),
|
||||
|
||||
Reference in New Issue
Block a user