can1357/oh-my-pi · error · ToolError

Unsupported launch key ${rawKey}

Error message

Unsupported launch key ${rawKey}

What it means

The send operation lets you inject key presses via `params.keys`; each key is uppercased and looked up in the KEY_INPUT table. If a key name is not in that table, sendData() throws ToolError 'Unsupported launch key <key>', listing the offending key verbatim.

Source

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

					log: ready.log,
					port: ready.port,
					host: ready.host,
					timeoutMs: timeoutMs(ready.timeout, 30),
				}
			: undefined,
		restart: params.restart ?? "no",
		persist: (params.persist ?? false) || detached,
		detached,
	};
}

function sendData(params: LaunchParams): string | undefined {
	let data = params.text ?? "";
	if (params.text && (params.enter ?? true)) data += KEY_INPUT.ENTER;
	for (const rawKey of params.keys ?? []) {
		const key = rawKey.trim().toUpperCase();
		const input = KEY_INPUT[key];
		if (input === undefined) throw new ToolError(`Unsupported launch key ${rawKey}`);
		data += input;
	}
	return data || undefined;
}

function operationFor(params: LaunchParams, session: ToolSession): DaemonOperation {
	switch (params.op) {
		case "start":
			return { op: "start", spec: commandSpec(params, session), owner: session.getSessionId?.() ?? undefined };
		case "list":
			return { op: "list" };
		case "logs":
			return {
				op: "logs",
				name: requiredName(params),
				lines: Math.min(1_000, Math.floor(params.lines ?? 100)),
				head: params.head ?? false,
				grep: params.grep,

View on GitHub (pinned to 9690622007)

Solutions

  1. Use canonical key names supported by the launch tool's KEY_INPUT table (e.g. "ENTER", "ESCAPE", "TAB", "UP", "C-c"-style ctrl combos as documented).
  2. Check the tool's parameter schema/description for the exact accepted key list.
  3. Send the text directly via `text` for printable input and reserve `keys` for control keys.

Example fix

// before
launch({ op: "send", name: "cli", keys: ["RETURN"] })
// throws: Unsupported launch key RETURN

// after
launch({ op: "send", name: "cli", keys: ["ENTER"] })
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_KEYS = new Set(["ENTER", "TAB", "ESCAPE", "UP", "DOWN", "LEFT", "RIGHT" /* per KEY_INPUT table */]);
for (const k of params.keys ?? []) {
  if (!SUPPORTED_KEYS.has(k.trim().toUpperCase())) throw new Error(`Unsupported launch key ${k}`);
}

Try / catch

try {
  await launchTool.run({ op: "send", name, keys });
} catch (err) {
  if (err instanceof ToolError && err.message.startsWith("Unsupported launch key")) {
    // correct the key name against the supported set and retry
  } else throw err;
}

Prevention

When it happens

Trigger: launch({ op: "send", name, keys: ["CTRL+SHIFT+T"] }) or keys: ["ESC"] if the table only defines "ESCAPE"; any non-canonical key name like "RETURN", "CMD", or a multi-key chord not present in KEY_INPUT.

Common situations: Guessing key names instead of using the tool's supported set (ENTER, TAB, ESCAPE, arrow keys, CTRL-letter combos as defined); lowercase/abbreviated spellings; sending chords the KEY_INPUT table does not encode.

Related errors


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