{"record":{"id":"5734ee7ca2214cf9","repo":"diegosouzapw/OmniRoute","slug":"duplicate-account","errorCode":"duplicate_account","errorMessage":"An Antigravity CLI connection for this account already exists. Pass overwriteExisting: true to replace it.","messagePattern":"An Antigravity CLI connection for this account already exists\\. Pass overwriteExisting: true to replace it\\.","errorType":"exception","errorClass":"AgyAuthFileError","httpStatus":409,"severity":"error","filePath":"src/lib/oauth/utils/agyAuthImport.ts","lineNumber":199,"sourceCode":"      const conn = c as JsonRecord;\n      return toNonEmptyString(conn.email)?.toLowerCase() === lowerEmail;\n    }) as JsonRecord | undefined) ?? null\n  );\n}\n\n// ──── Create / update connection ──────────────────────────────────────────────\n\nexport async function createConnectionFromAgyToken(\n  enriched: EnrichedAgyAuth,\n  options: CreateAgyConnectionOptions\n): Promise<{ connection: JsonRecord; created: boolean }> {\n  const resolvedEmail = options.email || enriched.email;\n\n  if (resolvedEmail) {\n    const existing = await findExistingAgyConnection(resolvedEmail);\n    if (existing) {\n      if (!options.overwriteExisting) {\n        throw new AgyAuthFileError(\n          \"An Antigravity CLI 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: resolvedEmail || (existing.email as string | undefined),\n        name:\n          options.name ||\n          (existing.name as string | undefined) ||\n          resolvedEmail ||\n          \"Antigravity CLI (imported)\",\n        testStatus: \"active\",\n        isActive: true,","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/utils/agyAuthImport.ts#L181-L217","documentation":"Error \"An Antigravity CLI connection for this account already exists. Pass overwriteExisting: true to replace it.\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/utils/agyAuthImport.ts:199 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"}