{"record":{"id":"01f524ae93b6a48e","repo":"paperclipai/paperclip","slug":"failed-to-install-the-adapter-runtime-command-via","errorCode":null,"errorMessage":"Failed to install the adapter runtime command via: ${installCommand}","messagePattern":"Failed to install the adapter runtime command via: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-utils/src/execution-target.ts","lineNumber":947,"sourceCode":"        graceSec: input.graceSec,\n      },\n    );\n    if (!recheck.timedOut && recheck.exitCode === 0) {\n      if (input.onLog) {\n        const reason = result.timedOut ? \"timed out\" : `exited ${result.exitCode ?? \"?\"}`;\n        await input.onLog(\n          \"stderr\",\n          `[paperclip] Install command ${reason} (${installCommand}) but ${detectCommand} is on PATH; continuing.\\n`,\n        );\n      }\n      return;\n    }\n  }\n\n  if (result.timedOut) {\n    throw new Error(`Timed out while installing the adapter runtime command via: ${installCommand}`);\n  }\n  throw new Error(`Failed to install the adapter runtime command via: ${installCommand}`);\n}\n\nexport async function ensureAdapterExecutionTargetFile(\n  runId: string,\n  target: AdapterExecutionTarget | null | undefined,\n  filePath: string,\n  options: AdapterExecutionTargetShellOptions,\n): Promise<void> {\n  await runAdapterExecutionTargetShellCommand(\n    runId,\n    target,\n    `mkdir -p ${shellQuote(path.posix.dirname(filePath))} && : > ${shellQuote(filePath)}`,\n    options,\n  );\n}\n\n/**\n * Ensure a working directory exists (and is a directory) on the execution target.","sourceCodeStart":929,"sourceCodeEnd":965,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/adapter-utils/src/execution-target.ts#L929-L965","documentation":"Thrown by ensureAdapterExecutionTargetRuntimeCommandInstalled when the install command exits with a non-zero code (not a timeout) AND the binary is still not found on PATH. This is the non-timeout counterpart to error 303: the install ran to completion but failed, and the detect-command recheck could not rescue it.","triggerScenarios":"Calling ensureAdapterExecutionTargetRuntimeCommandInstalled with target.transport === 'sandbox'. The install command returned { timedOut: false, exitCode: non-zero }. Then either no detectCommand is set, or `command -v <detectCommand>` returned non-zero.","commonSituations":"The install command fails due to missing build dependencies in the sandbox image; the package version does not exist or has a broken transitive dependency; the install command lacks permissions to write to the global install directory; the sandbox filesystem is read-only.","solutions":["Inspect the stderr/stdout from the install command (logged via onLog) to find the specific install failure reason.","Pre-install the runtime CLI in the sandbox image to avoid runtime install failures entirely.","Fix the install command to handle the sandbox environment (e.g. use --prefix for a writable directory, add missing build tools).","Verify the package name and version in the install command are correct and published."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await ensureAdapterExecutionTargetRuntimeCommandInstalled(input);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"Failed to install the adapter runtime command\")) {\n    // The install command exited non-zero — inspect onLog output for details\n    throw new Error(`Adapter runtime install failed. Command: ${input.installCommand}. Check logs for details.`);\n  }\n  throw err;\n}","preventionTips":["Use an onLog callback to capture install command stderr/stdout for diagnosis.","Ensure the sandbox image has the build dependencies the install command needs.","Verify the package name and version in the install command are correct and accessible."],"tags":["sandbox","install","execution-target","adapter-utils"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}