{"record":{"id":"4935c699b3111e8d","repo":"diegosouzapw/OmniRoute","slug":"duplicate-account-4935c6","errorCode":"duplicate_account","errorMessage":"A Claude connection for this account already exists. Pass overwriteExisting: true to replace it.","messagePattern":"A Claude connection for this account already exists\\. Pass overwriteExisting: true to replace it\\.","errorType":"exception","errorClass":"ClaudeAuthFileError","httpStatus":409,"severity":"error","filePath":"src/lib/oauth/utils/claudeAuthImport.ts","lineNumber":188,"sourceCode":"      const stored = toNonEmptyString(psd.accountUUID);\n      return stored !== null && stored.toLowerCase() === lower;\n    }) as JsonRecord | undefined) ?? null\n  );\n}\n\n// ──── Create / update connection ──────────────────────────────────────────────\n\nexport async function createConnectionFromAuthFile(\n  enriched: EnrichedClaudeAuth,\n  options: CreateConnectionOptions\n): Promise<{ connection: JsonRecord; created: boolean }> {\n  // Duplicate detection by accountUUID (skipped when bootstrap failed)\n  if (enriched.accountUUID) {\n    const existing = await findExistingClaudeConnection(enriched.accountUUID);\n\n    if (existing) {\n      if (!options.overwriteExisting) {\n        throw new ClaudeAuthFileError(\n          \"A Claude connection for this account already exists. Pass overwriteExisting: true to replace it.\",\n          409,\n          \"duplicate_account\"\n        );\n      }\n\n      const updated = await updateProviderConnection(existing.id as string, {\n        accessToken: enriched.accessToken,\n        refreshToken: enriched.refreshToken,\n        expiresAt: enriched.expiresAt,\n        email:\n          options.email || enriched.email || (existing.email as string | undefined) || undefined,\n        name:\n          options.name ||\n          (existing.name as string | undefined) ||\n          options.email ||\n          enriched.email ||\n          \"Claude (imported)\",","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/utils/claudeAuthImport.ts#L170-L206","documentation":"Error \"A Claude connection for this account already exists. Pass overwriteExisting: true to replace it.\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/utils/claudeAuthImport.ts:188 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":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}