paperclipai/paperclip · error · Error

Command not found in PATH: "${command}"

Error message

Command not found in PATH: "${command}"

What it means

Thrown by the spawn-target resolver when localProcessSandbox is enabled and the requested command itself is not found in PATH (resolved is null). With sandboxing on, the command must resolve to an absolute executable before it can be wrapped in Bubblewrap, so an unresolved command is an error rather than a deferred exec failure.

Source

Thrown at packages/adapter-utils/src/server-utils.ts:2377

      args,
      env: Object.fromEntries(
        Object.entries(options.remoteEnv ?? {}).filter((entry): entry is [string, string] => typeof entry[1] === "string"),
      ),
    });
    return {
      command: sshResolved,
      args: spawnTarget.args,
      cwd: process.cwd(),
      cleanup: spawnTarget.cleanup,
    };
  }

  const resolved = await resolveCommandPath(command, cwd, env);
  const executable = resolved ?? command;

  if (options.localProcessSandbox) {
    if (!resolved) {
      throw new Error(`Command not found in PATH: "${command}"`);
    }
    const requestedSandboxCommand = options.localProcessSandbox.command?.trim() || "bwrap";
    const sandboxCommand = await resolveCommandPath(requestedSandboxCommand, cwd, env);
    if (!sandboxCommand) {
      throw new Error(
        `Local process confinement requires Bubblewrap, but "${requestedSandboxCommand}" was not found in PATH. Install bwrap or configure filesystemSandboxCommand.`,
      );
    }
    const sandboxTarget = await buildLocalProcessSandboxSpawnTarget({
      executable,
      args,
      cwd,
      options: options.localProcessSandbox,
    });
    return { ...sandboxTarget, command: sandboxCommand };
  }

  if (process.platform !== "win32") {

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Install the missing agent CLI and confirm `which <command>` finds it in the same PATH the adapter uses.
  2. Pass an absolute path for the command instead of relying on PATH resolution.
  3. Fix the PATH/env passed to the adapter so it includes the tool's bin directory.
  4. If you did not want confinement, disable localProcessSandbox for this run.

Example fix

// before
{ command: 'codex', localProcessSandbox: {...} }
// after
{ command: '/usr/local/bin/codex', localProcessSandbox: {...} }
Defensive patterns

Strategy: validation

Validate before calling

const resolved = await resolveCommandPath(command, cwd, env);
if (localProcessSandbox && !resolved) {
  throw new Error(`Command '${command}' not found; install it or pass an absolute path`);
}

Prevention

When it happens

Trigger: Calling the execute/spawn path with options.localProcessSandbox set and a command (e.g. an agent CLI) that resolveCommandPath cannot locate in cwd's PATH. Because sandboxing is on, the null resolution becomes a hard error at line 2377.

Common situations: Agent binary not installed or not on PATH; wrong command name configured; PATH differs between the shell that installed the tool and the process running the adapter; a node_modules-local bin not resolved because cwd is wrong.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/430626247c314ce2. Report an issue: GitHub.