can1357/oh-my-pi · error · ToolError

${outputText}\n\nCommand failed: missing exit status

Error message

${outputText}\n\nCommand failed: missing exit status

What it means

After a bash result that is neither success, cancelled, nor timed out, if result.exitCode is undefined BashTool throws this ToolError stating the process finished without an exit status. The captured outputText is included for debugging. This is a defensive path for executors that return no exit code.

Source

Thrown at packages/coding-agent/src/tools/bash.ts:667

		timeoutSec: number | undefined,
		outputText: string,
	): void {
		if (result.cancelled) {
			// Local executor output already carries a leading `[Command cancelled]`
			// notice from the sink; PTY/bridge output does not, so annotate only
			// the latter.
			const out = normalizeResultOutput(result);
			const annotated = out.startsWith("[Command cancelled]") ? out : out ? `${out}\n\n[Command aborted]` : out;
			throw new ToolError(annotated || "Command aborted");
		}
		if (result.timedOut === true) {
			const out = normalizeResultOutput(result);
			const message =
				timeoutSec === undefined ? "Command timed out" : `Command timed out after ${timeoutSec} seconds`;
			throw new ToolError(out ? `${out}\n\n[${message}]` : message);
		}
		if (result.exitCode === undefined) {
			throw new ToolError(`${outputText}\n\nCommand failed: missing exit status`);
		}
	}

	async #buildCompletedResult(
		result: BashResult | BashInteractiveResult,
		timeoutSec: number | undefined,
		options: {
			requestedTimeoutSec?: number;
			notices?: readonly string[];
			terminalId?: string;
			wallTimeMs?: number;
		} = {},
	): Promise<AgentToolResult<BashToolDetails>> {
		const exitCode = result.exitCode;
		const failedExit = exitCode !== undefined && exitCode !== 0;

		const outputLines = [this.#formatResultOutput(result)];
		const notices: string[] = [];

View on GitHub (pinned to 9690622007)

Solutions

  1. Rerun the command — a missing exit status is usually transient infrastructure loss, not a command error.
  2. Check the captured output above the message for the real failure (OOM killer, crash, signal).
  3. Inspect system logs (dmesg/journalctl) for OOM or signal kills of the shell process.
  4. If using a custom executor/bridge, ensure it always reports a numeric exitCode (signal deaths can map to 128+signum).
Defensive patterns

Strategy: retry

Try / catch

try { await bash.run(cmd, opts); } catch (e) { if (e instanceof ToolError && e.message.includes('missing exit status')) { /* inspect outputText, check OOM/signals, retry once */ } else throw e; }

Prevention

When it happens

Trigger: The executor returned a result where exitCode === undefined and timedOut/cancelled are not true — e.g. the process was killed by a signal the bridge didn't translate into an exit code, the PTY/bridge connection dropped, or an executor bug omitted exitCode.

Common situations: Process killed via SIGKILL/OOM through a code path that doesn't map signals to exit codes; infrastructure/PTY failures between the shell and the tool; custom executor implementations that don't always set exitCode.

Related errors


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