can1357/oh-my-pi · error · ToolError

Bundled agent "${agentName}" for vibe cli "${cli}" is unavai

Error message

Bundled agent "${agentName}" for vibe cli "${cli}" is unavailable.

What it means

#resolveWorker maps a vibe CLI name to a bundled agent via VIBE_CLI_AGENT[cli] and getBundledAgent(agentName). If the bundled agent registry has no such agent, spawning cannot proceed, so it throws. This indicates the CLI→agent mapping or the bundled agent table is out of sync (e.g. a custom/trimmed build or stale registry).

Source

Thrown at packages/coding-agent/src/vibe/runtime.ts:398

		const key = scopeKey(scope, "");
		const predecessor = this.#terminationTails.get(key) ?? Promise.resolve();
		const released = Promise.withResolvers<void>();
		const tail = predecessor.then(() => released.promise);
		this.#terminationTails.set(key, tail);
		await predecessor;
		try {
			return await operation();
		} finally {
			released.resolve();
			if (this.#terminationTails.get(key) === tail) this.#terminationTails.delete(key);
		}
	}

	#resolveWorker(session: VibeParentSession, cli: VibeCli): ResolvedVibeWorker {
		const agentName = VIBE_CLI_AGENT[cli];
		const agent = getBundledAgent(agentName);
		if (!agent) {
			throw new ToolError(`Bundled agent "${agentName}" for vibe cli "${cli}" is unavailable.`);
		}
		const agentModelOverrides = session.settings.get("task.agentModelOverrides");
		// Same contract as the task spawn path: the expansion discards the role
		// alias (`@task`, `@smol`), so patterns and role identity come from one
		// call — the child's inherited retry-fallback chain is keyed off the role.
		const { patterns, role } = resolveAgentModelSelection({
			settingsOverride: agentModelOverrides[agentName],
			agentModel: agent.model,
			settings: session.settings,
			activeModelPattern: session.getActiveModelString?.(),
			fallbackModelPattern: session.getModelString?.(),
		});
		return { agent, modelOverride: patterns, modelRole: role };
	}

	async #appendLifecycleEvent(
		session: VibeParentSession,
		event: VibeLifecycleEvent,

View on GitHub (pinned to 9690622007)

Solutions

  1. Verify getBundledAgent can resolve the mapped agent name for the cli; register bundled agents at startup if using a custom entrypoint.
  2. Upgrade/repair the oh-my-pi installation so bundled agents match the VIBE_CLI_AGENT mapping.
  3. Check whether test/initialization code cleared or replaced the bundled-agent registry.

Example fix

// before
await spawn({ cli: "fast", prompt }); // agent never registered in custom build
// after
import { registerBundledAgents } from ".../agents";
registerBundledAgents();
await spawn({ cli: "fast", prompt });
Defensive patterns

Strategy: validation

Validate before calling

import { getBundledAgent } from ".../agents";
const agentName = VIBE_CLI_AGENT[cli];
if (!getBundledAgent(agentName)) throw new Error(`Bundled agent "${agentName}" missing; register bundled agents before vibe spawn`);

Type guard

function cliResolvable(cli: VibeCli): boolean {
  return !!getBundledAgent(VIBE_CLI_AGENT[cli]);
}

Try / catch

try {
  await vibe.spawn(session, { cli, prompt });
} catch (err) {
  if (err instanceof ToolError && /is unavailable/.test(err.message)) {
    registerBundledAgents(); // then retry once
  } else throw err;
}

Prevention

When it happens

Trigger: Calling vibe spawn (which calls #spawnLocked → #resolveWorker) with a cli whose mapped agent name is not present in the bundled agent registry — e.g. agents were not registered, a custom build pruned the agent, or the VIBE_CLI_AGENT table references a renamed agent.

Common situations: Custom builds that exclude bundled agents; version mismatch where the installed package renamed bundled agents; test harnesses that stub getBundledAgent; plugin/registration code that never registered the bundled agents.

Related errors


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