Mintplex-Labs/anything-llm · warning · Error

Command aborted

Error message

Command aborted

What it means

Thrown by the visible-bash MCP tool after a spawned shell command finishes when signal?.aborted is true (the AbortSignal passed to the tool was triggered). The thrown message prepends any captured output (truncated) so the caller sees partial progress before the abort marker. The finally block runs cleanup (temp output/exit-code files).

Source

Thrown at open-computer/services/extensions/visible-bash.ts:187

          });
        });

        // Brief wait for output file to flush
        await new Promise((r) => setTimeout(r, 100));

        let output = "";
        try {
          output = readFileSync(outputFile, "utf-8");
        } catch {}

        let realExitCode = exitCode;
        try {
          const ecStr = readFileSync(exitCodeFile, "utf-8").trim();
          if (ecStr) realExitCode = parseInt(ecStr, 10);
        } catch {}

        if (signal?.aborted) {
          throw new Error(
            output
              ? `${truncateOutput(output)}\n\nCommand aborted`
              : "Command aborted"
          );
        }

        if (timedOut) {
          throw new Error(
            output
              ? `${truncateOutput(output)}\n\nCommand timed out after ${timeout} seconds`
              : `Command timed out after ${timeout} seconds`
          );
        }

        const text = truncateOutput(output) || "(no output)";

        if (realExitCode !== 0 && realExitCode !== null) {
          throw new Error(`${text}\n\nCommand exited with code ${realExitCode}`);

View on GitHub (pinned to 526360e320)

Solutions

  1. Re-run the command without the abort, or with a longer signal deadline.
  2. If the abort is intentional, treat the partial output in the message as the result and resume from there.
  3. Ensure the AbortSignal is not accidentally shared/cancelled by unrelated tool calls.
  4. Make the target command resumable (checkpoint files) so an abort does not lose all progress.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const result = await bash({ command, signal });
} catch (e) {
  if (/Command aborted/.test(e.message)) {
    // partial output is in e.message above the marker
    return { aborted: true, partialOutput: e.message };
  }
  throw e;
}

Prevention

When it happens

Trigger: The agent/framework cancelled the tool call (e.g. user pressed stop, a parent step's timeout fired, or a higher-level abort propagated the signal), or the command was deliberately run with a short signal-based deadline that fired.

Common situations: User pressed ESC/stop during a long-running bash command; the orchestrator aborted the step due to an upstream failure; a watchdog abort fired; the AbortSignal was shared across multiple tool calls and a sibling cancelled it.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13). Data as JSON: /api/errors/d0537265b254bb2e. Report an issue: GitHub.