diegosouzapw/OmniRoute · error · AgyAuthFileError

identity_unverified

identity_unverified

Error message

Could not verify the account email from the agy token (no userinfo). Pass overwriteExisting: true to import without email verification.

What it means

Identity guard in createConnectionFromAgyToken: the token could not be enriched with a verified account email (userinfo lookup produced nothing), so duplicate detection cannot run safely. Import is blocked unless the caller explicitly passes overwriteExisting: true to accept an unverified import.

Solutions

  1. Pass overwriteExisting: true to import without email verification when the source is trusted
  2. Retry later if the userinfo endpoint failure was transient (network/5xx)
  3. Provide an explicit options.email to bypass the userinfo lookup
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/oauth/utils/agyAuthImport.ts:232 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/03fc8d8f099dafc7. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/oauth/utils/agyAuthImport.ts:232

          resolvedEmail ||
          "Antigravity CLI (imported)",
        testStatus: "active",
        isActive: true,
        providerSpecificData: {
          ...toRecord(existing.providerSpecificData),
          clientProfile: "cli",
          tokenType: enriched.tokenType,
          authMethod: enriched.authMethod,
          projectId: enriched.projectId ?? toRecord(existing.providerSpecificData).projectId,
          tier: enriched.tier ?? toRecord(existing.providerSpecificData).tier,
          importedAt: new Date().toISOString(),
        },
      });

      return { connection: updated || existing, created: false };
    }
  } else if (!options.overwriteExisting) {
    throw new AgyAuthFileError(
      "Could not verify the account email from the agy token (no userinfo). Pass overwriteExisting: true to import without email verification.",
      409,
      "identity_unverified"
    );
  }

  const name = options.name || resolvedEmail || "Antigravity CLI (imported)";

  const connection = await createProviderConnection({
    provider: "agy",
    authType: "oauth",
    name,
    email: resolvedEmail || undefined,
    accessToken: enriched.accessToken,
    refreshToken: enriched.refreshToken,
    expiresAt: enriched.expiresAt,
    isActive: true,
    testStatus: "active",

View on GitHub (pinned to a179ffed5b)