can1357/oh-my-pi · error · ToolError

start requires application

Error message

start requires application

What it means

commandSpec() builds the daemon spec for the 'start' operation. After resolving the name it requires `params.application` — the executable/command to launch. If absent it throws ToolError 'start requires application'; a start without an application has nothing to run.

Source

Thrown at packages/coding-agent/src/tools/hub/launch.ts:184

	/** wait: output line that satisfied the pattern. */
	matched?: string;
	/** describe: immutable launch spec backing the command/cwd detail lines. */
	spec?: DaemonSpec;
}

function requiredName(params: LaunchParams): string {
	if (!params.name) throw new ToolError(`${params.op} requires name`);
	return params.name;
}

function timeoutMs(value: number | undefined, fallbackSeconds: number): number {
	const seconds = Math.max(0.05, Math.min(3_600, value ?? fallbackSeconds));
	return Math.round(seconds * 1_000);
}

function commandSpec(params: LaunchParams, session: ToolSession): DaemonSpec {
	const name = requiredName(params);
	if (!params.application) throw new ToolError("start requires application");
	const ready = params.ready;
	const detached = params.detached ?? false;
	if (ready?.port !== undefined && (!Number.isInteger(ready.port) || ready.port < 1 || ready.port > 65_535)) {
		throw new ToolError("ready.port must be an integer from 1 to 65535");
	}
	if (ready && !ready.log && ready.port === undefined) throw new ToolError("ready requires log or port");
	return {
		name,
		application: params.application,
		args: params.args ?? [],
		env: params.env ?? {},
		cwd: resolveToCwd(params.cwd ?? session.cwd, session.cwd),
		pty: detached ? false : (params.pty ?? true),
		ready: ready
			? {
					log: ready.log,
					port: ready.port,
					host: ready.host,

View on GitHub (pinned to 9690622007)

Solutions

  1. Set the `application` parameter to the executable path or command to launch (e.g. "bun", "/usr/bin/node", "./server").
  2. Confirm the parameter key is `application`, not `command` or `cmd`.
  3. Ensure the value is a non-empty string.

Example fix

// before
launch({ op: "start", name: "api", args: ["run", "dev"] })
// throws: start requires application

// after
launch({ op: "start", name: "api", application: "bun", args: ["run", "dev"] })
Defensive patterns

Strategy: validation

Validate before calling

if (!params.application?.trim()) throw new Error("start requires application");

Try / catch

try {
  await launchTool.run({ op: "start", name, application });
} catch (err) {
  if (err instanceof ToolError && err.message === "start requires application") {
    // add the application command and retry
  } else throw err;
}

Prevention

When it happens

Trigger: Calling launch with op 'start' (or an op routed to commandSpec) and omitting `application`, or passing an empty string.

Common situations: Model filled in name/cwd but forgot the application command; automation reuses a params object where application was stripped; confusing the tool with a generic 'process' tool that uses a different key (e.g. cmd/command) instead of `application`.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


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