{"record":{"id":"3c78856ab799e661","repo":"musistudio/claude-code-router","slug":"opencode-app-is-already-running-outside-ccr-pid","errorCode":null,"errorMessage":"OpenCode App is already running outside CCR (PID ${unmanagedPid}). Close it before opening an OpenCode App profile.","messagePattern":"OpenCode App is already running outside CCR \\(PID (.+?)\\)\\. Close it before opening an OpenCode App profile\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/profiles/launch-service.ts","lineNumber":220,"sourceCode":"        \"Close it before reopening this profile.\"\n      );\n    }\n    stopOpenCodeAppBotWorker(profile.id);\n  }\n  const otherProfile = runningProfileAppForAgent(\"opencode\", \"app\", profile.id);\n  if (otherProfile) {\n    const stopped = await stopRunningProfileApp(profileRuntimeKey(otherProfile.profileId, \"app\"), otherProfile);\n    if (!stopped && isProfileAppRunning(otherProfile)) {\n      throw new Error(\n        `OpenCode App is already running with ${otherProfile.profileName || otherProfile.profileId}. ` +\n        \"Close it before switching OpenCode App profiles.\"\n      );\n    }\n    stopOpenCodeAppBotWorker(otherProfile.profileId);\n  }\n  const unmanagedPid = findRunningOpenCodeAppPid(profile.appPath);\n  if (unmanagedPid) {\n    throw new Error(\n      `OpenCode App is already running outside CCR (PID ${unmanagedPid}). ` +\n      \"Close it before opening an OpenCode App profile.\"\n    );\n  }\n  const launch = {\n    ...launchOpenCodeAppProfile(\n      CONFIGDIR,\n      profile,\n      configResult.file,\n      configResult.inlineConfig,\n      botEnv\n    ),\n    launchSignature\n  };\n  const entry = registerProfileApp(profile, \"app\", launch);\n  const started = await waitForStableProfileAppStart(entry, 12000, 1000);\n  if (!started) {\n    cleanupProfileAppEntry(profileRuntimeKey(profile.id, \"app\"), entry);","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/profiles/launch-service.ts#L202-L238","documentation":"Error \"OpenCode App is already running outside CCR (PID ${unmanagedPid}). Close it before opening an OpenCode App profile.\" thrown in musistudio/claude-code-router.","triggerScenarios":"Thrown at packages/core/src/profiles/launch-service.ts:220 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"}