{"record":{"id":"009e81033b45a8d6","repo":"jackwener/OpenCLI","slug":"waiting-for-google-session-cookies","errorCode":null,"errorMessage":"Waiting for Google session cookies","messagePattern":"Waiting for Google session cookies","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"warning","filePath":"clis/gemini/auth.js","lineNumber":44,"sourceCode":"      }\n      return { ok: true, name: m[1].trim() };\n    })()\n  `);\n  if (probe?.kind === 'auth') throw new AuthRequiredError('gemini.google.com', probe.detail);\n  if (!probe?.ok) throw new CommandExecutionError(`Unexpected Gemini probe: ${JSON.stringify(probe)}`);\n  return { name: probe.name };\n}\n\nregisterSiteAuthCommands({\n  site: 'gemini',\n  domain: 'gemini.google.com',\n  loginUrl: 'https://accounts.google.com/ServiceLogin?continue=https%3A%2F%2Fgemini.google.com%2F',\n  columns: ['name'],\n  quickCheck: hasGoogleSessionCookie,\n  verify: verifyGeminiIdentity,\n  poll: async (page) => {\n    if (!await hasGoogleSessionCookie(page)) {\n      throw new AuthRequiredError('gemini.google.com', 'Waiting for Google session cookies');\n    }\n    return verifyGeminiIdentity(page);\n  },\n});\n","sourceCodeStart":26,"sourceCodeEnd":49,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/gemini/auth.js#L26-L49","documentation":"An AuthRequiredError thrown by the login poll loop while waiting for the user to finish Google sign-in. During `opencli gemini login`, the poller checks for session cookies; until SID/SAPISID appear it keeps reporting 'Waiting for Google session cookies' instead of proceeding to full identity verification.","triggerScenarios":"During login polling: `hasGoogleSessionCookie(page)` still false after the user was given the Google login URL — cookies not yet set in the automation browser.","commonSituations":"User hasn't completed the Google sign-in yet; 2FA/challenge pending; login done in a different browser than the automation one; cookies immediately cleared by settings; login page blocked by network policy.","solutions":["Complete the Google sign-in (including 2FA) inside the automation browser window","Ensure you log in to the same profile the CLI automates (not your personal browser)","Wait for the poll to re-check — this error during polling is expected until cookies are set","Verify network access to accounts.google.com and that no extension clears cookies"],"exampleFix":"// no code fix — operational\n// 1. opencli gemini login\n// 2. finish sign-in (incl. 2FA) in the automated browser\n// 3. poll succeeds once SID/SAPISID cookies exist","handlingStrategy":"retry","validationCode":"const cookies = await getCookies('https://accounts.google.com');\nif (!cookies.some(c => ['SID','SAPISID','__Secure-1PSID'].includes(c.name))) {\n  console.log('Finish sign-in (incl. 2FA) in the automated browser...');\n}","typeGuard":"function sessionReady(cookies) {\n  return cookies.some(c => ['SID','SAPISID','__Secure-1PSID'].includes(c.name));\n}","tryCatchPattern":"try {\n  await pollLogin();\n} catch (e) {\n  if (e.name === 'AuthRequiredError' && /Waiting for Google session cookies/.test(e.message)) {\n    // expected during login — keep polling or prompt user to complete sign-in\n  } else throw e;\n}","preventionTips":["Complete Google sign-in including 2FA in the automated browser window","Use the same browser profile the CLI automates","Ensure network access to accounts.google.com","Treat this message during login polling as informational, not fatal"],"tags":["auth","gemini","login-polling"],"backgroundTag":"auth-session-required","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}