{"record":{"id":"cc6ac3a5cfc83258","repo":"musistudio/claude-code-router","slug":"profile-opencode-app-bot-worker-failed-format","errorCode":null,"errorMessage":"[profile] OpenCode App bot worker failed: ${formatError(error)}","messagePattern":"\\[profile\\] OpenCode App bot worker failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/core/src/profiles/launch-service.ts","lineNumber":1444,"sourceCode":"  child.once(\"exit\", (code, signal) => {\n    if (openCodeAppBotWorker === child) {\n      openCodeAppBotWorker = undefined;\n      openCodeAppBotWorkerProfileId = undefined;\n      openCodeAppBotWorkerSignature = undefined;\n      openCodeAppBotWorkerStateDir = undefined;\n    }\n    if (code && code !== 0) {\n      console.warn(`[profile] OpenCode App bot worker exited: code=${code}${signal ? ` signal=${signal}` : \"\"}`);\n    }\n  });\n  child.once(\"error\", (error) => {\n    if (openCodeAppBotWorker === child) {\n      openCodeAppBotWorker = undefined;\n      openCodeAppBotWorkerProfileId = undefined;\n      openCodeAppBotWorkerSignature = undefined;\n      openCodeAppBotWorkerStateDir = undefined;\n    }\n    console.warn(`[profile] OpenCode App bot worker failed: ${formatError(error)}`);\n  });\n}\n\nfunction startCodexAppBotWorker(config: AppConfig, profile: ReturnType<typeof findProfileForOpen>): void {\n  const botEnv = botGatewayProfileEnv(config, profile, \"app\");\n  if (botEnv.CCR_BOT_GATEWAY_ENABLED !== \"true\") {\n    stopCodexAppBotWorker(profile.id);\n    return;\n  }\n  const existing = codexAppBotWorkers.get(profile.id);\n  if (existing && !existing.child.killed && existing.child.exitCode === null) {\n    return;\n  }\n  stopCodexAppBotWorker(profile.id);\n  const plan = buildProfileLaunchPlan(CONFIGDIR, profile, \"app\", [\"codex-bot-worker\", \"--workspace-name\", profile.name || profile.id]);\n  const launch = profileLaunchSpawnCommand(plan);\n  const env: NodeJS.ProcessEnv = {\n    ...process.env,","sourceCodeStart":1426,"sourceCodeEnd":1462,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/profiles/launch-service.ts#L1426-L1462","documentation":"Emitted on the 'error' event of the OpenCode App bot worker child process: spawn failure (missing binary), kill, or IPC failure. The module-level singletons (openCodeAppBotWorker, profile id, signature, state dir) are reset, so the next launch signature can restart it.","triggerScenarios":"Spawning the OpenCode bot worker fails — executable not found (ENOENT), not executable (EACCES), or the process dies with an error event before normal exit.","commonSituations":"OpenCode CLI not installed or not on PATH for the gateway user; stale launchSignature after an app update moves binaries; sandboxed environments blocking process spawn.","solutions":["Confirm the OpenCode binary/app exists and runs from the gateway's environment.","Reinstall or re-link the OpenCode app so the launcher path in the profile resolves.","Clear stale worker state if the launch signature changed after an upgrade (it auto-restarts on next launch).","Check OS-level restrictions (permissions, containers) on spawning children."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Install the OpenCode CLI for the launching user","Re-link binaries after app upgrades","Ensure spawn is permitted in sandboxed environments"],"tags":["child-process","spawn","bot-worker","opencode"],"backgroundTag":"child-process-spawn-failed","analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}