musistudio/claude-code-router · warning

[profile] Claude App bot worker exited: code=${code}${signal

Error message

[profile] Claude App bot worker exited: code=${code}${signal ? ` signal=${signal}` : ""}

What it means

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.

Source

Thrown at packages/core/src/profiles/launch-service.ts:1360

    detached: false,
    env,
    stdio: ["ignore", "ignore", "pipe"],
    windowsHide: true
  });
  claudeAppBotWorker = child;
  claudeAppBotWorkerProfileId = profile.id;
  claudeAppBotWorkerStateDir = botEnv.CCR_BOT_GATEWAY_STATE_DIR;
  child.stderr?.on("data", (chunk) => {
    console.warn(`[profile] Claude App bot worker stderr: ${chunk.toString("utf8").trim()}`);
  });
  child.once("exit", (code, signal) => {
    if (claudeAppBotWorker === child) {
      claudeAppBotWorker = undefined;
      claudeAppBotWorkerProfileId = undefined;
      claudeAppBotWorkerStateDir = undefined;
    }
    if (code && code !== 0) {
      console.warn(`[profile] Claude App bot worker exited: code=${code}${signal ? ` signal=${signal}` : ""}`);
    }
  });
  child.once("error", (error) => {
    if (claudeAppBotWorker === child) {
      claudeAppBotWorker = undefined;
      claudeAppBotWorkerProfileId = undefined;
      claudeAppBotWorkerStateDir = undefined;
    }
    console.warn(`[profile] Claude App bot worker failed: ${formatError(error)}`);
  });
}

function startOpenCodeAppBotWorker(
  config: AppConfig,
  profile: ReturnType<typeof findProfileForOpen>,
  configFile: string,
  inlineConfig: string,
  launchSignature: string

View on GitHub (pinned to 99f24806c6)

Solutions

  1. Check the worker's stderr/log output preceding the exit for the crash cause
  2. If OOM (signal SIGKILL, code null), increase memory limits or reduce worker concurrency
  3. Verify the Claude App credentials/config the worker needs are valid
  4. Restart the profile/bot; if it crash-loops, run the worker manually to see the stack trace

Example fix

# inspect why it died
journalctl -u opencode | grep -A5 "Claude App bot worker"
dmesg | grep -i oom   # rule out memory kill
# restart the bot via the profile launch API/UI
Defensive patterns

Strategy: try-catch

Try / catch

child.once("exit", (code, signal) => { if (code !== 0) { logWorker stderr; scheduleRestart(profileId); } });

Prevention

When it happens

Trigger: 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.

Common situations: Memory exhaustion triggering OOM kill; expired or invalid credentials causing the worker to fail fast; worker version incompatibility with the parent after an upgrade.


AI-assisted analysis of musistudio/claude-code-router@99f24806c6 (2026-08-27). Data as JSON: /api/errors/2f3e977848be7939. Report an issue: GitHub.