jackwener/OpenCLI · warning · AuthRequiredError

Waiting for Suno Clerk __session/__client cookie

Error message

Waiting for Suno Clerk __session/__client cookie

What it means

During the interactive login flow, the poller repeatedly checks for the Clerk `__session` cookie to know when sign-in has finished. Each poll that runs before the cookie appears throws AuthRequiredError('suno.com', 'Waiting for Suno Clerk __session/__client cookie'); the auth framework treats this as 'not done yet' and keeps polling until you complete sign-in or the timeout expires.

Source

Thrown at clis/suno/auth.js:59

    }
  })()`);
  if (probe?.kind === 'auth') throw new AuthRequiredError('suno.com', probe.detail);
  if (probe?.kind === 'http') throw new CommandExecutionError(`HTTP ${probe.httpStatus} from clerk.suno.com`);
  if (probe?.kind === 'exception') throw new CommandExecutionError(`Suno whoami failed: ${probe.detail}`);
  if (!probe?.ok) throw new CommandExecutionError(`Unexpected Suno probe: ${JSON.stringify(probe)}`);
  return { user_id: probe.user_id, name: probe.name };
}

registerSiteAuthCommands({
  site: 'suno',
  domain: 'suno.com',
  loginUrl: 'https://suno.com/?sign-in=true',
  columns: ['user_id', 'name'],
  quickCheck: hasSunoClerkCookie,
  verify: verifySunoIdentity,
  poll: async (page) => {
    if (!await hasSunoClerkCookie(page)) {
      throw new AuthRequiredError('suno.com', 'Waiting for Suno Clerk __session/__client cookie');
    }
    return verifySunoIdentity(page);
  },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Complete the sign-in in the opened browser window (including email code / 2FA)
  2. Wait — the message is expected mid-login and clears once __session is set
  3. If it loops forever, reload the login page and start sign-in again
  4. Confirm no extension is blocking cookie writes for clerk.suno.com

Example fix

// no code fix needed — complete the interactive login
// after sign-in the poll sees __session and calls verifySunoIdentity successfully
await cli('suno', 'login'); // finishes when cookie appears
Defensive patterns

Strategy: try-catch

Validate before calling

const cookies = await page.getCookies({ url: 'https://clerk.suno.com' });
const loggedIn = cookies.some(c => c.name === '__session' && c.value);
if (!loggedIn) console.log('Waiting for user to complete Suno sign-in...');

Type guard

function isLoginPendingError(e) {
  return e instanceof Error && /Waiting for .* cookie/.test(e.message);
}

Try / catch

try {
  await pollLogin(page);
} catch (e) {
  if (isLoginPendingError(e)) return { pending: true }; // keep polling; expected mid-login
  throw e;
}

Prevention

When it happens

Trigger: The login poll callback (registerSiteAuthCommands poll) fires while the user has not yet completed the Suno sign-in at https://suno.com/?sign-in=true, so hasSunoClerkCookie(page) is still false.

Common situations: User is slow entering credentials/2FA; login page left open without submitting; SSO redirect taking a while; user closed the login tab before finishing.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/315670ed43c823b2. Report an issue: GitHub.