{"record":{"id":"2f3e977848be7939","repo":"musistudio/claude-code-router","slug":"profile-claude-app-bot-worker-exited-code-cod","errorCode":null,"errorMessage":"[profile] Claude App bot worker exited: code=${code}${signal ? ` signal=${signal}` : \"\"}","messagePattern":"\\[profile\\] Claude App bot worker exited: code=(.+?)(.+?)` : \"\"\\}","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/core/src/profiles/launch-service.ts","lineNumber":1360,"sourceCode":"    detached: false,\n    env,\n    stdio: [\"ignore\", \"ignore\", \"pipe\"],\n    windowsHide: true\n  });\n  claudeAppBotWorker = child;\n  claudeAppBotWorkerProfileId = profile.id;\n  claudeAppBotWorkerStateDir = botEnv.CCR_BOT_GATEWAY_STATE_DIR;\n  child.stderr?.on(\"data\", (chunk) => {\n    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","sourceCodeStart":1342,"sourceCodeEnd":1378,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/profiles/launch-service.ts#L1342-L1378","documentation":"The Claude App bot worker child process exited with a non-zero code (optionally with a signal). The parent clears its worker bookkeeping and warns. The bot worker is no longer running, so Claude App bot functionality stops until restarted.","triggerScenarios":"The worker process crashing due to an internal error, being killed by a signal (OOM killer, SIGKILL), or exiting after a fatal config/auth error; observed in the child 'exit' handler with code !== 0.","commonSituations":"Memory exhaustion triggering OOM kill; expired or invalid credentials causing the worker to fail fast; worker version incompatibility with the parent after an upgrade.","solutions":["Check the worker's stderr/log output preceding the exit for the crash cause","If OOM (signal SIGKILL, code null), increase memory limits or reduce worker concurrency","Verify the Claude App credentials/config the worker needs are valid","Restart the profile/bot; if it crash-loops, run the worker manually to see the stack trace"],"exampleFix":"# inspect why it died\njournalctl -u opencode | grep -A5 \"Claude App bot worker\"\ndmesg | grep -i oom   # rule out memory kill\n# restart the bot via the profile launch API/UI","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"child.once(\"exit\", (code, signal) => { if (code !== 0) { logWorker stderr; scheduleRestart(profileId); } });","preventionTips":["Capture worker stderr to a persistent log","Add an auto-restart supervisor with backoff","Memory-limit and monitor workers to catch OOM early"],"tags":["worker-process","claude-app","bot","crash"],"backgroundTag":"worker-process-exited","analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}