{"record":{"id":"f34ccca096465200","repo":"musistudio/claude-code-router","slug":"opencode-app-is-already-running-with-otherprofil","errorCode":null,"errorMessage":"OpenCode App is already running with ${otherProfile.profileName || otherProfile.profileId}. Close it before switching OpenCode App profiles.","messagePattern":"OpenCode App is already running with (.+?)\\. Close it before switching OpenCode App profiles\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/profiles/launch-service.ts","lineNumber":211,"sourceCode":"        profileId: profile.id,\n        profileName: profile.name,\n        surface: \"app\"\n      };\n    }\n    const stopped = await stopRunningProfileApp(profileRuntimeKey(profile.id, \"app\"), existing);\n    if (!stopped && isProfileAppRunning(existing)) {\n      throw new Error(\n        `${appName} is still running with stale settings for ${profile.name || profile.id}. ` +\n        \"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,","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/profiles/launch-service.ts#L193-L229","documentation":"Error \"OpenCode App is already running with ${otherProfile.profileName || otherProfile.profileId}. Close it before switching OpenCode App profiles.\" thrown in musistudio/claude-code-router.","triggerScenarios":"Thrown at packages/core/src/profiles/launch-service.ts:211 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"}