{"record":{"id":"26de4e7c8546a7ef","repo":"diegosouzapw/OmniRoute","slug":"missing-access-token","errorCode":"missing_access_token","errorMessage":"access_token is missing or empty in the agy token file","messagePattern":"access_token is missing or empty in the agy token file","errorType":"exception","errorClass":"AgyAuthFileError","httpStatus":400,"severity":"error","filePath":"src/lib/oauth/utils/agyAuthImport.ts","lineNumber":79,"sourceCode":"}\n\n// ──── Parse & validate ────────────────────────────────────────────────────────\n\n/**\n * Parse the Antigravity CLI (`agy`) token file. It nests the token under `.token`,\n * uses an ISO `expiry` string, and has NO `id_token`. A flat top-level shape is\n * accepted as a fallback.\n */\nexport function parseAndValidateAgyToken(raw: unknown): ParsedAgyAuth {\n  const doc = toRecord(raw);\n  // agy nests credentials under `.token`; fall back to the top level for flat exports.\n  const token = doc.token && typeof doc.token === \"object\" ? toRecord(doc.token) : doc;\n\n  const accessToken = toNonEmptyString(token.access_token);\n  const refreshToken = toNonEmptyString(token.refresh_token);\n\n  if (!accessToken) {\n    throw new AgyAuthFileError(\n      \"access_token is missing or empty in the agy token file\",\n      400,\n      \"missing_access_token\"\n    );\n  }\n\n  if (!refreshToken) {\n    throw new AgyAuthFileError(\n      \"refresh_token is missing or empty in the agy token file\",\n      400,\n      \"missing_refresh_token\"\n    );\n  }\n\n  // agy uses an ISO `expiry`; also accept a unix-ms `expiry_date`/`expires_at` for safety.\n  let expiresAt: string | null = null;\n  const isoExpiry = toNonEmptyString(token.expiry) ?? toNonEmptyString(token.expires_at);\n  if (isoExpiry) {","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/utils/agyAuthImport.ts#L61-L97","documentation":"Error \"access_token is missing or empty in the agy token file\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/utils/agyAuthImport.ts:79 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"}