{"record":{"id":"41634a2a582e9552","repo":"musistudio/claude-code-router","slug":"failed-to-open-profile-name-profile-id-sp","errorCode":null,"errorMessage":"Failed to open ${profile.name || profile.id}: ${spawnError}","messagePattern":"Failed to open (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/profiles/launch-service.ts","lineNumber":156,"sourceCode":"  const plan = buildProfileLaunchPlan(CONFIGDIR, profile, surface);\n  if (path.isAbsolute(plan.command) && !existsSync(plan.command)) {\n    throw new Error(`Profile launcher was not found: ${plan.command}. Re-save the profile and try again.`);\n  }\n\n  const launch = profileLaunchSpawnCommand(plan);\n  const child = spawn(launch.command, launch.args, {\n    detached: true,\n    env: {\n      ...process.env,\n      ...plan.env,\n      ...botGatewayProfileEnv(config, profile, surface),\n      ...(profile.agent === \"claude-code\" ? claudeCodeUtcTimezoneEnvOverride() : {})\n    },\n    stdio: \"ignore\"\n  });\n  const spawnError = await waitForImmediateSpawnError(child, 500);\n  if (spawnError) {\n    throw new Error(`Failed to open ${profile.name || profile.id}: ${spawnError}`);\n  }\n  child.unref();\n\n  return {\n    message: `Opened ${profile.name || profile.id}.`,\n    profileId: profile.id,\n    profileName: profile.name,\n    surface\n  };\n}\n\nasync function openOpenCodeAppProfile(config: AppConfig, profile: ReturnType<typeof findProfileForOpen>): Promise<ProfileOpenResult> {\n  const appName = \"OpenCode App\";\n  const profileGatewayConfig = await ensureProfileGateway(config, profile, appName);\n  const configResult = writeOpenCodeGatewayConfig(\n    CONFIGDIR,\n    profileGatewayConfig,\n    profile,","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/profiles/launch-service.ts#L138-L174","documentation":"Error \"Failed to open ${profile.name || profile.id}: ${spawnError}\" thrown in musistudio/claude-code-router.","triggerScenarios":"Thrown at packages/core/src/profiles/launch-service.ts:156 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}