can1357/oh-my-pi · error · Error
${availability.reason ?? "Julia kernel unavailable"}
Error message
${availability.reason ?? "Julia kernel unavailable"} What it means
`JuliaKernel.start` boots a new kernel subprocess and first re-checks availability with `checkJuliaKernelAvailability`, throwing this plain Error (probe reason or generic fallback) when the probe fails. Unlike the executor path, there is no retry or cancellation wrapper here — the error propagates directly to whoever requested a kernel. Note availability probes for a given cwd+interpreter are cached on success only, so a fresh probe runs each time after a failure.
Source
Thrown at packages/coding-agent/src/eval/jl/kernel.ts:149
if (val !== undefined) {
const k_b64 = Buffer.from(key).toString("base64");
const v_b64 = Buffer.from(val).toString("base64");
envPairs.push(`${k_b64}:${v_b64}`);
}
}
}
const envPairsStr = envPairs.join(" ");
const codeB64 = Buffer.from(code).toString("base64");
return `run\t${msgId}\t${cwdB64}\t${silentVal}\t${storeHistVal}\t${envPairsStr}\t${codeB64}`;
},
});
}
static async start(options: KernelStartOptions): Promise<JuliaKernel> {
const availability = await checkJuliaKernelAvailability(options.cwd, options.interpreter);
if (!availability.ok) {
throw new Error(availability.reason ?? "Julia kernel unavailable");
}
let runtime = availability.runtime;
if (!runtime) {
const { env: shellEnv } = (await Settings.init()).getShellConfig();
runtime = options.interpreter
? resolveExplicitJuliaRuntime(options.interpreter, options.cwd, filterEnv(shellEnv))
: resolveJuliaRuntime(options.cwd, filterEnv(shellEnv));
}
const spawnEnv: Record<string, string> = {};
for (const key in runtime.env) {
const value = runtime.env[key];
if (typeof value === "string") spawnEnv[key] = value;
}
for (const key in options.env) {
const value = options.env[key];
if (typeof value === "string") spawnEnv[key] = value;
}View on GitHub (pinned to 9690622007)
Solutions
- Install Julia and ensure the `julia` binary is executable and on PATH for the process spawning the kernel.
- Use the thrown reason: "not found on PATH" → install/PATH fix; "Tried: ..." list shows which binaries failed and why.
- Pass `interpreter` as the resolved path to a real `julia` executable (not the juliaup shim) if shims cause probe failures.
- Verify manually with `julia -e 'exit(0)'` in the target environment to reproduce and debug the probe.
- Retry after installing — failed probes are not cached, so the next start re-probes and picks up a new install.
Example fix
// before
const kernel = await JuliaKernel.start({ cwd: projectDir }); // throws: not on PATH
// after
const kernel = await JuliaKernel.start({
cwd: projectDir,
interpreter: "/usr/local/bin/julia",
}); Defensive patterns
Strategy: validation
Validate before calling
import { checkJuliaKernelAvailability } from ".../eval/jl/kernel";
const avail = await checkJuliaKernelAvailability(options.cwd, options.interpreter);
if (!avail.ok) throw new Error(`Cannot start Julia kernel: ${avail.reason}`);
const kernel = await JuliaKernel.start(options); Type guard
function canStartKernel(a: { ok: boolean; runtime?: unknown }): a is { ok: true; runtime: NonNullable<typeof a.runtime> } {
return a.ok && a.runtime !== undefined;
} Try / catch
let kernel;
try {
kernel = await JuliaKernel.start({ cwd, interpreter });
} catch (e) {
if (String(e).includes("Julia")) {
// probe again after install, or surface install instructions
throw new Error("Install Julia: https://julialang.org/ — original: " + e);
}
throw e;
} Prevention
- Run checkJuliaKernelAvailability before attempting JuliaKernel.start.
- Ensure `julia` is on PATH for the exact process/user spawning the kernel.
- Resolve juliaup shims to the real binary and pass it as `interpreter`.
- Failed probes aren't cached — retry start() after installing Julia.
When it happens
Trigger: Direct `JuliaKernel.start({ cwd, interpreter, ... })` when Julia is not on PATH, the explicit interpreter path is wrong, all enumerated runtimes fail the `julia -e 'exit(0)'` probe, or the availability probe was cancelled.
Common situations: Embedding/SDK users spawning a kernel directly without Julia installed; pointing `interpreter` at a `juliaia`/`juliaup` shim that doesn't behave as a plain binary; probing from a service account whose PATH lacks user-local julia installs; corrupt Julia installation failing to exit cleanly.
Related errors
- ${availability.reason ?? "Julia kernel unavailable"}
- imageUrls exposure "${name}" requires the ${name} binary on
- ${displayName} executable not found on PATH
- ssh binary not found on PATH
- Julia backend is unavailable in this session. Pass language:
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/13fd0cb31c740f4a.
Report an issue: GitHub.