{"record":{"id":"859c091904abf6f7","repo":"musistudio/claude-code-router","slug":"profile-claude-app-bot-worker-failed-formater","errorCode":null,"errorMessage":"[profile] Claude App bot worker failed: ${formatError(error)}","messagePattern":"\\[profile\\] Claude App bot worker failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/core/src/profiles/launch-service.ts","lineNumber":1369,"sourceCode":"    console.warn(`[profile] Claude App bot worker stderr: ${chunk.toString(\"utf8\").trim()}`);\n  });\n  child.once(\"exit\", (code, signal) => {\n    if (claudeAppBotWorker === child) {\n      claudeAppBotWorker = undefined;\n      claudeAppBotWorkerProfileId = undefined;\n      claudeAppBotWorkerStateDir = undefined;\n    }\n    if (code && code !== 0) {\n      console.warn(`[profile] Claude App bot worker exited: code=${code}${signal ? ` signal=${signal}` : \"\"}`);\n    }\n  });\n  child.once(\"error\", (error) => {\n    if (claudeAppBotWorker === child) {\n      claudeAppBotWorker = undefined;\n      claudeAppBotWorkerProfileId = undefined;\n      claudeAppBotWorkerStateDir = undefined;\n    }\n    console.warn(`[profile] Claude App bot worker failed: ${formatError(error)}`);\n  });\n}\n\nfunction startOpenCodeAppBotWorker(\n  config: AppConfig,\n  profile: ReturnType<typeof findProfileForOpen>,\n  configFile: string,\n  inlineConfig: string,\n  launchSignature: string\n): void {\n  const botEnv = botGatewayProfileEnv(config, profile, \"app\");\n  if (botEnv.CCR_BOT_GATEWAY_ENABLED !== \"true\") {\n    stopOpenCodeAppBotWorker(profile.id);\n    return;\n  }\n  if (\n    openCodeAppBotWorker &&\n    !openCodeAppBotWorker.killed &&","sourceCodeStart":1351,"sourceCodeEnd":1387,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/profiles/launch-service.ts#L1351-L1387","documentation":"Emitted on the child process 'error' event for the Claude App bot worker: the process could not be spawned, was killed, or failed to communicate (spawn ENOENT, EACCES, or signal death). The module-level worker references are cleared and the gateway continues without the bot worker.","triggerScenarios":"startClaudeAppBotWorker spawns the worker but the binary cannot be found (ENOENT), is not executable (EACCES), or the process errors before exit handling — the once('error') handler fires.","commonSituations":"Claude CLI/app binary missing from PATH or not installed; permissions problem on the executable; node runtime path (CCR_CLI_NODE_PATH-style) invalid; antivirus/OS killing the child on Windows.","solutions":["Verify the worker executable exists and is runnable from the same environment (run it manually).","Reinstall/repair the Claude app/CLI so its runtime path resolves.","Check permissions and, on Windows, antivirus interference with the child process.","Confirm the gateway profile env (bot worker state dir, node path) is set for the launching user."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Verify the Claude worker binary is installed and on PATH","Check executable permissions","Ensure required gateway env vars are present when spawning"],"tags":["child-process","spawn","bot-worker","claude"],"backgroundTag":"child-process-spawn-failed","analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}