musistudio/claude-code-router · error · Error

Failed to open ${profile.name || profile.id}: ${spawnError}

Error message

Failed to open ${profile.name || profile.id}: ${spawnError}

What it means

Error "Failed to open ${profile.name || profile.id}: ${spawnError}" thrown in musistudio/claude-code-router.

Source

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

  const plan = buildProfileLaunchPlan(CONFIGDIR, profile, surface);
  if (path.isAbsolute(plan.command) && !existsSync(plan.command)) {
    throw new Error(`Profile launcher was not found: ${plan.command}. Re-save the profile and try again.`);
  }

  const launch = profileLaunchSpawnCommand(plan);
  const child = spawn(launch.command, launch.args, {
    detached: true,
    env: {
      ...process.env,
      ...plan.env,
      ...botGatewayProfileEnv(config, profile, surface),
      ...(profile.agent === "claude-code" ? claudeCodeUtcTimezoneEnvOverride() : {})
    },
    stdio: "ignore"
  });
  const spawnError = await waitForImmediateSpawnError(child, 500);
  if (spawnError) {
    throw new Error(`Failed to open ${profile.name || profile.id}: ${spawnError}`);
  }
  child.unref();

  return {
    message: `Opened ${profile.name || profile.id}.`,
    profileId: profile.id,
    profileName: profile.name,
    surface
  };
}

async function openOpenCodeAppProfile(config: AppConfig, profile: ReturnType<typeof findProfileForOpen>): Promise<ProfileOpenResult> {
  const appName = "OpenCode App";
  const profileGatewayConfig = await ensureProfileGateway(config, profile, appName);
  const configResult = writeOpenCodeGatewayConfig(
    CONFIGDIR,
    profileGatewayConfig,
    profile,

View on GitHub (pinned to 99f24806c6)

When it happens

Trigger: Thrown at packages/core/src/profiles/launch-service.ts:156 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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