{"record":{"id":"3ebc92ffb7bb3efc","repo":"nexu-io/open-design","slug":"def-name-cli-is-not-installed-or-not-on-path","errorCode":null,"errorMessage":"${def.name} CLI is not installed or not on PATH","messagePattern":"(.+?) CLI is not installed or not on PATH","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/memory-llm.ts","lineNumber":978,"sourceCode":"    });\n  }\n\n  const def = getAgentDef(provider.agentId);\n  if (!def) {\n    throw new Error(`Local CLI agent \"${provider.agentId}\" is not installed`);\n  }\n\n  let configuredAgentEnv = {};\n  try {\n    const appConfig = options?.dataDir ? await readAppConfig(options.dataDir) : {};\n    configuredAgentEnv = agentCliEnvForAgent(appConfig.agentCliEnv, def.id);\n  } catch {\n    configuredAgentEnv = {};\n  }\n\n  const launch = resolveAgentLaunch(def, configuredAgentEnv);\n  if (!launch?.launchPath) {\n    throw new Error(`${def.name} CLI is not installed or not on PATH`);\n  }\n\n  // The memory extractor is a tool-less, JSON-only background call that never\n  // reads project files, so it has no reason to run in the daemon's own cwd.\n  // Falling back to process.cwd() there meant a bun-based agent (OpenCode) ran\n  // its startup `bun install` in whatever directory the daemon was launched from\n  // — clobbering a pnpm workspace (dev checkout). Use a neutral temp cwd.\n  const cwd =\n    typeof options?.projectRoot === 'string' && options.projectRoot.trim()\n      ? options.projectRoot\n      : os.tmpdir();\n  const prompt = [\n    system,\n    '',\n    'You are running as a background memory extractor. Do not use tools. Return strict JSON only.',\n    '',\n    user,\n  ].join('\\n');","sourceCodeStart":960,"sourceCodeEnd":996,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/memory-llm.ts#L960-L996","documentation":"The agent definition exists in the registry, but resolveAgentLaunch could not find the agent's executable binary on the system PATH or via configured paths. The resolution returned no selectedPath, so launchPath is null. The agent CLI binary is not installed or not discoverable.","triggerScenarios":"The agent binary (e.g. claude, codex, opencode) is not installed on the system; the binary exists but its directory is not on PATH; the configured agentCliEnv path override is wrong; GUI-launched daemon has a different PATH than the shell.","commonSituations":"Fresh machine without the agent CLI installed; PATH not including the agent's install directory (e.g. ~/.bun/bin for opencode, global npm bin for claude); agent CLI was uninstalled; daemon launched from GUI without inheriting shell PATH.","solutions":["Install the missing agent CLI (e.g. npm install -g @anthropic-ai/claude-code, bun install -g opencode)","Verify the binary is discoverable by running 'which claude' or 'which codex' in the daemon's environment","Configure agentCliEnv in app config to point to the binary's directory","Restart the daemon after installing so PATH is re-evaluated"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { getAgentDef } from './runtimes/registry';\nimport { resolveAgentLaunch } from './runtimes/launch';\nimport { which } from 'shelljs'; // or use child_process.execSync('which ' + bin)\n\nasync function assertAgentBinaryAvailable(agentId) {\n  const def = getAgentDef(agentId);\n  if (!def) throw new Error(`Agent ${agentId} not registered`);\n  const launch = resolveAgentLaunch(def, {});\n  if (!launch?.launchPath) {\n    throw new Error(`${def.name} CLI binary not found. Install it and ensure it is on PATH.`);\n  }\n  return launch;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install all required agent CLIs before configuring them as memory providers","Verify binary discoverability in the daemon's actual runtime environment (not just your shell)","For GUI-launched daemons, ensure agent install directories are on the system PATH, not just the shell PATH","Configure agentCliEnv in app config to explicitly point to binary locations if PATH discovery is unreliable"],"tags":["agent-cli","memory-extraction","path","installation"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}