{"record":{"id":"fb3ff1532e77c3c9","repo":"stablyai/orca","slug":"that-claude-account-no-longer-exists","errorCode":null,"errorMessage":"That Claude account no longer exists.","messagePattern":"That Claude account no longer exists\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/main/claude-accounts/service.ts","lineNumber":530,"sourceCode":"      id: account.id,\n      email: account.email,\n      managedAuthRuntime: account.managedAuthRuntime ?? 'host',\n      wslDistro: account.wslDistro ?? null,\n      authMethod: account.authMethod ?? 'unknown',\n      organizationUuid: account.organizationUuid ?? null,\n      organizationName: account.organizationName ?? null,\n      createdAt: account.createdAt,\n      updatedAt: account.updatedAt,\n      lastAuthenticatedAt: account.lastAuthenticatedAt\n    }\n  }\n\n  private requireAccount(accountId: string): ClaudeManagedAccount {\n    const account = this.store\n      .getSettings()\n      .claudeManagedAccounts.find((entry) => entry.id === accountId)\n    if (!account) {\n      throw new Error('That Claude account no longer exists.')\n    }\n    return account\n  }\n\n  private normalizeActiveSelection(): void {\n    const settings = this.store.getSettings()\n    const nextSelection = pruneInvalidClaudeRuntimeSelection(\n      normalizeClaudeRuntimeSelection(settings),\n      settings.claudeManagedAccounts\n    )\n    if (\n      nextSelection.host !== settings.activeClaudeManagedAccountId ||\n      JSON.stringify(nextSelection) !== JSON.stringify(normalizeClaudeRuntimeSelection(settings))\n    ) {\n      this.store.updateSettings({\n        activeClaudeManagedAccountId: nextSelection.host,\n        activeClaudeManagedAccountIdsByRuntime: nextSelection\n      })","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/claude-accounts/service.ts#L512-L548","documentation":"Thrown by requireAccount() when no managed account in settings.claudeManagedAccounts has the given accountId. It is the internal precondition guard for operations (select, reauth, remove) that reference an account id; a missing id means the account was deleted or never existed, or settings are stale.","triggerScenarios":"An IPC handler invokes selectAccount/reauthenticateAccount/removeAccount with an accountId that is not present in the current settings list. The account was removed by another window/race. A stale UI list sent an outdated id.","commonSituations":"Account was deleted in another window but the first window's list is stale. Race between remove and a concurrent select. Hardcoded/test account id. Settings file edited externally.","solutions":["Refresh the account list from getSnapshot() before issuing the operation.","Guard at the IPC layer: check the account exists before calling into the service.","Treat this error as a soft 'not found' and refresh the UI rather than retrying blindly.","Ensure removeAccount and selectAccount are serialized so a concurrent delete cannot invalidate an in-flight select."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const account = settings.claudeManagedAccounts.find(a => a.id === accountId)\nif (!account) {\n  // refresh UI list; do not call into the service\n}","typeGuard":null,"tryCatchPattern":"try {\n  await selectAccount(accountId)\n} catch (error) {\n  if (error instanceof Error && /no longer exists/.test(error.message)) {\n    await refreshAccountList()\n    return\n  }\n  throw error\n}","preventionTips":["Refresh the account list before issuing operations.","Serialize remove and select so a concurrent delete cannot invalidate a select.","Treat 'no longer exists' as a soft refresh signal.","Validate account existence at the IPC boundary."],"tags":["claude-accounts","not-found","validation","accounts"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}