can1357/oh-my-pi · error · ToolError

Julia backend is unavailable in this session. Pass language:

Error message

Julia backend is unavailable in this session. Pass language: ${alternatives.join(" or ")} or install Julia.

What it means

resolveBackend throws this when the Julia backend is allowed by config (eval.jl true / PI_JL not 0) but juliaBackend.isAvailable() reports the runtime cannot be used in this session (Julia not installed or not launchable). The message enumerates the alternative backends that ARE enabled so the caller can switch languages. This is a runtime availability failure, distinct from the config-disabled error.

Source

Thrown at packages/coding-agent/src/tools/eval.ts:288

				Boolean,
			);
			throw new ToolError(
				alternatives.length > 0
					? `Ruby backend is unavailable in this session. Pass language: ${alternatives.join(" or ")} or install Ruby.`
					: 'Ruby backend is unavailable in this session. Install Ruby to use language: "rb".',
			);
		}
		return { backend: rubyBackend };
	}
	if (language === "julia") {
		if (!allowJl) throw new ToolError("Julia backend is disabled (PI_JL=0 or eval.jl = false).");
		const available = await juliaBackend.isAvailable(session, probeOpts);
		throwIfAborted(probeOpts?.signal);
		if (!available) {
			const alternatives = [allowJs ? '"js"' : null, allowPy ? '"py"' : null, allowRb ? '"rb"' : null].filter(
				Boolean,
			);
			throw new ToolError(
				alternatives.length > 0
					? `Julia backend is unavailable in this session. Pass language: ${alternatives.join(" or ")} or install Julia.`
					: 'Julia backend is unavailable in this session. Install Julia to use language: "jl".',
			);
		}
		return { backend: juliaBackend };
	}
	if (!allowJs) throw new ToolError("JavaScript backend is disabled (PI_JS=0 or eval.js = false).");
	return { backend: jsBackend };
}
function formatEvalInputLanguage(value: string): string {
	if (value === "py" || value === "python") return "python";
	if (value === "js" || value === "javascript") return "javascript";
	if (value === "rb" || value === "ruby") return "ruby";
	if (value === "jl" || value === "julia") return "julia";
	return value;
}

View on GitHub (pinned to 9690622007)

Solutions

  1. Install Julia (e.g. juliaup or your package manager) so the runtime is on PATH.
  2. Verify with `julia --version` in the same environment/session where the agent runs.
  3. Switch the cell to an enabled alternative: pass language "js" or "py" (or "rb") as listed in the error message.

Example fix

// before
{ "language": "jl", "code": "println(1+1)" }
// after (fallback to enabled backend)
{ "language": "py", "code": "print(1+1)" }
Defensive patterns

Strategy: fallback

Validate before calling

const backends = resolveEvalBackends(session);
const alt = backends.js ? "js" : backends.python ? "py" : backends.ruby ? "rb" : null;
if (!backends.julia && !alt) { /* no eval backend usable */ }

Type guard

function isJuliaAvailableError(msg: string): boolean { return msg.includes("Julia backend is unavailable"); }

Try / catch

try {
  return await evalTool.execute(id, { language: "jl", code }, signal);
} catch (e) {
  if (e instanceof ToolError && e.message.includes("Julia backend is unavailable")) {
    return evalTool.execute(id, { language: "py", code }, signal); // fallback backend
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling eval with language "jl" when Julia is not installed or not resolvable on PATH, while at least one of PI_JS/eval.js, PI_PY/eval.py, or PI_RB/eval.rb is enabled; the alternatives list is built from those allowances (empty list yields the "Install Julia" variant instead).

Common situations: Fresh machine or container image without Julia installed; Julia not on PATH inside the agent's environment; a cell running on a host where the session was spawned without shell PATH inheritance.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/12e47fd6966fa361. Report an issue: GitHub.