can1357/oh-my-pi · error · Error
${label} failed: ${reason}
Error message
${label} failed: ${reason} What it means
`executeWithBudget` runs an initialization/setup code snippet with cancellation and timeout support. If the snippet reports status "error", it throws `"<label> failed: <reason>"` with the kernel-reported error value (or a default "init failed" message). This wraps kernel-side failures during setup (e.g. prelude/bootstrap code) into a single actionable error.
Source
Thrown at packages/coding-agent/src/eval/kernel-base.ts:606
}
const timer =
timeoutMs > 0
? setTimeout(() => controller.abort(createAbortError("TimeoutError", `${label} timed out`)), timeoutMs)
: undefined;
if (timer) cleanups.push(() => clearTimeout(timer));
try {
throwIfAborted(controller.signal, label);
const result = await this.execute(code, {
signal: controller.signal,
silent: true,
storeHistory: false,
} as TExecuteOptions);
if (result.cancelled) {
throw createAbortError(result.timedOut ? "TimeoutError" : "AbortError", `${label} cancelled`);
}
if (result.status === "error") {
const reason = result.error?.value ?? `${this.#options.languageName} kernel init failed`;
throw new Error(`${label} failed: ${reason}`);
}
} finally {
for (const cleanup of cleanups) cleanup();
}
}
#waitForExitWithTimeout(timeoutMs: number): Promise<number | null> {
if (!this.#exitedPromise) return Promise.resolve(0);
const exitedPromise = this.#exitedPromise;
const timeout = new Promise<null>(resolve => {
const timer = setTimeout(() => resolve(null), Math.max(0, timeoutMs));
timer.unref?.();
});
return Promise.race([exitedPromise.then(code => code as number | null), timeout]);
}
}
View on GitHub (pinned to 9690622007)
Solutions
- Read the embedded `reason` (the kernel error value) — it names the actual init failure
- Fix the prelude/init code that fails (syntax, missing dependency, unsupported API)
- Verify the language runtime/interpreter version supports the init script
Example fix
// before: init prelude uses unavailable API
const sys = await import("node:foo"); // fails in kernel realm
// after
const fs = await import("node:fs"); // supported module Defensive patterns
Strategy: try-catch
Validate before calling
// validate the init script against the target runtime before start
// e.g. ensure imports used by the prelude exist in the kernel realm
for (const mod of requiredModules) {
if (!supportedModules.has(mod)) throw new Error(`prelude needs unsupported module ${mod}`);
} Try / catch
try {
await kernel.start();
} catch (err) {
if (err instanceof Error && / failed: /.test(err.message)) {
logger.error("kernel init failed", { reason: err.message });
// fix prelude or restart with a minimal prelude
}
} Prevention
- Test prelude/bootstrap snippets against the exact kernel runtime version
- Keep init scripts minimal to reduce failure surface
- Log the embedded reason — it names the real init error
When it happens
Trigger: Kernel bootstrap/prelude code executed via `executeWithBudget` (called from `start`) returns a result with `status === "error"` — e.g. the init script raised an exception, or the execution was cut short by error after partial failure.
Common situations: A bad prelude/config injected into the kernel raising on startup; a kernel that starts but fails importing required modules during init; version drift between the eval harness and the kernel runtime causing init script incompatibility.
Related errors
- ${this.#options.languageName} kernel is not running
- agent() received invalid arguments: ${result.summary}
- agent() blocked: turn token budget exhausted (${turnBudget.s
- ${failureMessage}${recoveryHint} (subagent failure: ${policy
- agent() isolated apply failed for ${result.id}${summary ? `:
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/135a462dfd02f22b.
Report an issue: GitHub.