{"record":{"id":"05323052f27767de","repo":"diegosouzapw/OmniRoute","slug":"invalid-auth-file","errorCode":"invalid_auth_file","errorMessage":"Not a Codex auth.json — unexpected auth_mode value","messagePattern":"Not a Codex auth\\.json — unexpected auth_mode value","errorType":"exception","errorClass":"CodexAuthFileError","httpStatus":400,"severity":"error","filePath":"src/lib/oauth/utils/codexAuthImport.ts","lineNumber":119,"sourceCode":"  email: string | null;\n  expiresAt: string | null;\n}\n\nexport interface CreateConnectionOptions {\n  name?: string;\n  email?: string;\n  overwriteExisting?: boolean;\n}\n\n// ──── Parse & validate ────────────────────────────────────────────────────────\n\nexport function parseAndValidateCodexAuth(raw: unknown): ParsedCodexAuth {\n  const doc = toRecord(raw);\n\n  // Codex CLI no longer writes auth_mode in auth.json (only OmniRoute's own export\n  // includes it). Accept both formats as long as the required tokens are present.\n  if (doc.auth_mode !== undefined && doc.auth_mode !== null && doc.auth_mode !== \"chatgpt\") {\n    throw new CodexAuthFileError(\n      \"Not a Codex auth.json — unexpected auth_mode value\",\n      400,\n      \"invalid_auth_file\"\n    );\n  }\n\n  const tokens = toRecord(doc.tokens);\n  const idToken = toNonEmptyString(tokens.id_token);\n  const accessToken = toNonEmptyString(tokens.access_token);\n  const refreshToken = toNonEmptyString(tokens.refresh_token);\n\n  if (!idToken) {\n    throw new CodexAuthFileError(\n      \"id_token is missing or empty in the auth.json\",\n      400,\n      \"missing_id_token\"\n    );\n  }","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/utils/codexAuthImport.ts#L101-L137","documentation":"Error \"Not a Codex auth.json — unexpected auth_mode value\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/utils/codexAuthImport.ts:119 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"}