Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

fix: explicit wslc choice over the wsl switch

ogsamrat2054748752bc
diff --git a/apps/server/src/box/backends/index.ts b/apps/server/src/box/backends/index.ts
index 8b56a7f3..774cc71f 100644
--- a/apps/server/src/box/backends/index.ts
+++ b/apps/server/src/box/backends/index.ts
@@ -240,7 +240,7 @@ export async function detectBackend({ boxHome, env = process.env, platform = pro
if (id === "bwrap") found = [{ backend: "bwrap", ...(await probeBwrap({ env, boxHome: boxHome ?? path.join(home, ".omnirush", "box"), run, exists, platform, arch, ...limit })) }];
else if (id === "apple") found = [{ backend: "apple", ...(await probeApple({ env, platform, arch, release, run, exists, ...limit })) }];
else if (id === "wsl") found = [{ backend: "wsl", ...(await probeWslDistro({ env, platform, run, exists, arch, ...limit })) }];
- else if (id === "wslc") found = [{ backend: "wslc", ...(await probeWslc({ env, platform, run, exists, arch, ...limit })) }];
+ else if (id === "wslc") found = [{ backend: "wslc", ...(await probeWslc({ env, platform, run, exists, arch, explicit: wanted === "wslc", ...limit })) }];
else if (id === "wsl-engine") {
if (platform !== "win32" || env.OMNIRUSH_BOX_WSL === "0") continue;
const bin = wslLauncher({ env, exists });
diff --git a/apps/server/src/box/backends/wslc.ts b/apps/server/src/box/backends/wslc.ts
index 9eb45fdc..716f44e7 100644
--- a/apps/server/src/box/backends/wslc.ts
+++ b/apps/server/src/box/backends/wslc.ts
@@ -63,10 +63,11 @@ export function parseWslcVersion(text: unknown): string {
return (/(\d+\.\d+\.\d+(?:\.\d+)?)/.exec(s) ?? [])[1] ?? "";
}
-export async function probeWslc({ env = process.env, platform = process.platform, run = runCommand, exists = existsSync, timeoutMs = 15_000, arch = process.arch }: { env?: Env; platform?: NodeJS.Platform; run?: RunCommand; exists?: (file: string) => boolean; timeoutMs?: number; arch?: string } = {}): Promise<RuntimeResult> {
+export async function probeWslc({ env = process.env, platform = process.platform, run = runCommand, exists = existsSync, timeoutMs = 15_000, arch = process.arch, explicit = false }: { env?: Env; platform?: NodeJS.Platform; run?: RunCommand; exists?: (file: string) => boolean; timeoutMs?: number; arch?: string; explicit?: boolean } = {}): Promise<RuntimeResult> {
const base = { name: "wslc", backend: "wslc" };
if (platform !== "win32") return { ...base, ok: false, reason: "WSL containers are Windows only" };
- if (env.OMNIRUSH_BOX_WSL === "0") return { ...base, ok: false, reason: "turned off (OMNIRUSH_BOX_WSL=0)" };
+ // OMNIRUSH_BOX_WSL=0 turns off the WSL distro and engines; wslc asked for by name still runs.
+ if (env.OMNIRUSH_BOX_WSL === "0" && !explicit) return { ...base, ok: false, reason: "turned off (OMNIRUSH_BOX_WSL=0)" };
const bin = findWslc({ env, exists });
if (!bin) {
// Tell "WSL is old" (one `wsl --update`) from "WSL is off" (admin, restart).