{"record":{"id":"5c8526e5a8623c58","repo":"jackwener/OpenCLI","slug":"huggingface-co","errorCode":null,"errorMessage":"huggingface.co","messagePattern":"huggingface\\.co","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"warning","filePath":"clis/hf/auth.js","lineNumber":38,"sourceCode":"  await page.goto('https://huggingface.co/');\n  await page.wait(1);\n  const probe = await page.evaluate(WHOAMI_PROBE);\n  if (probe?.kind === 'auth') throw new AuthRequiredError('huggingface.co', probe.detail);\n  if (probe?.kind === 'http') throw new CommandExecutionError(`HTTP ${probe.httpStatus} from HF /api/whoami-v2`);\n  if (probe?.kind === 'exception') throw new CommandExecutionError(`HF whoami failed: ${probe.detail}`);\n  if (!probe?.ok) throw new CommandExecutionError(`Unexpected HF probe: ${JSON.stringify(probe)}`);\n  return { username: probe.username, fullname: probe.fullname, type: probe.type };\n}\n\nregisterSiteAuthCommands({\n  site: 'hf',\n  domain: 'huggingface.co',\n  loginUrl: 'https://huggingface.co/login',\n  columns: ['username', 'fullname', 'type'],\n  verify: verifyHfIdentity,\n  poll: async (page) => {\n    const probe = await page.evaluate(WHOAMI_PROBE);\n    if (!probe?.ok) throw new AuthRequiredError('huggingface.co', 'Waiting for Hugging Face login');\n    return { username: probe.username, fullname: probe.fullname, type: probe.type };\n  },\n});\n","sourceCodeStart":20,"sourceCodeEnd":42,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/hf/auth.js#L20-L42","documentation":"The hf login poll throws AuthRequiredError('huggingface.co', 'Waiting for Hugging Face login') while the login flow is polling: the whoami probe does not yet report a logged-in session. It signals that the user has not completed login in the browser window (or the session was lost).","triggerScenarios":"During the hf auth login poll, WHOAMI_PROBE returns probe.ok falsy — user hasn't finished logging in at huggingface.co/login, or the session cookie expired/cleared mid-poll.","commonSituations":"User closed the browser before completing login; login timed out; HF session invalid (logged out elsewhere); cookies blocked by browser settings.","solutions":["Complete the login in the opened browser window at huggingface.co/login","Re-run the hf auth login command and finish login before the poll expires","Check that cookies are enabled and no extension clears them","Verify an existing session at huggingface.co; if logged out, log in first"],"exampleFix":"// before\npoll: page => ... // throws while not logged in\n// after\n// user completes login at https://huggingface.co/login before poll timeout, then poll returns identity","handlingStrategy":"try-catch","validationCode":"const loggedIn = await page.evaluate(() => document.cookie.includes('token') || !!document.querySelector('[data-testid=\"profile\"]'));\nif (!loggedIn) console.warn('Complete HF login before running commands');","typeGuard":"function isLoggedIn(probe) { return !!probe && probe.ok === true && typeof probe.username === 'string'; }","tryCatchPattern":"try { identity = await poll(page); } catch (e) { if (e instanceof AuthRequiredError) { console.error('Please log in at https://huggingface.co/login and retry'); } else throw e; }","preventionTips":["Complete the browser login before the poll timeout","Keep cookies enabled and avoid clearing them mid-flow","Confirm session validity at huggingface.co before automation","Re-run hf auth login when sessions expire"],"tags":["auth","huggingface","login","polling"],"backgroundTag":"auth-required-login-incomplete","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}