jackwener/OpenCLI · warning · AuthRequiredError
Waiting for WeChat Channels sessionid cookie
Error message
Waiting for WeChat Channels sessionid cookie
What it means
During the interactive login flow, the poll callback repeatedly checks for the sessionid cookie while the user scans the QR code. Each poll that finds no cookie yet throws this AuthRequiredError — it signals 'still waiting for you to complete login', not a hard failure, until the cookie appears and verification runs.
Source
Thrown at clis/wechat-channels/auth.js:58
}
})()`);
if (probe?.kind === 'auth') throw new AuthRequiredError('channels.weixin.qq.com', probe.detail);
if (probe?.kind === 'http') throw new CommandExecutionError(`HTTP ${probe.httpStatus} from auth_data`);
if (probe?.kind === 'exception') throw new CommandExecutionError(`WeChat Channels whoami failed: ${probe.detail}`);
if (!probe?.ok) throw new CommandExecutionError(`Unexpected WeChat Channels probe: ${JSON.stringify(probe)}`);
return { user_id: probe.user_id, name: probe.name };
}
registerSiteAuthCommands({
site: 'wechat-channels',
domain: 'channels.weixin.qq.com',
loginUrl: 'https://channels.weixin.qq.com/login.html?from=assistant',
columns: ['user_id', 'name'],
quickCheck: hasWechatChannelsSessionCookie,
verify: verifyWechatChannelsIdentity,
poll: async (page) => {
if (!await hasWechatChannelsSessionCookie(page)) {
throw new AuthRequiredError('channels.weixin.qq.com', 'Waiting for WeChat Channels sessionid cookie');
}
return verifyWechatChannelsIdentity(page);
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Scan the QR code promptly with the correct WeChat account; if it expired, reload login.html for a fresh code.
- Ensure the login happens in the same browser profile/session the tool is polling.
- After the cookie appears, verification runs automatically — no action needed on this error during polling.
- If polling never succeeds despite login, confirm cookies are visible to page.getCookies({ url: 'https://channels.weixin.qq.com' }) (correct profile, not partitioned).
- Restart the login flow if the QR expired multiple times.
Example fix
// before // QR left on screen, user idle → repeated 'Waiting for WeChat Channels sessionid cookie' // after // 1. reload https://channels.weixin.qq.com/login.html?from=assistant // 2. scan the fresh QR within its validity window // 3. poll succeeds once sessionid is set
Defensive patterns
Strategy: try-catch
Validate before calling
// Poll cookie presence yourself before/while waiting:
const cookies = await page.getCookies({ url: 'https://channels.weixin.qq.com' });
const ready = cookies.some(c => c.name === 'sessionid' && c.value); Type guard
function hasSession(cookies) { return Array.isArray(cookies) && cookies.some(c => c.name === 'sessionid' && !!c.value); } Try / catch
try {
await waitForLogin(page);
} catch (e) {
if (/Waiting for WeChat Channels sessionid cookie/.test(e.message)) {
// still waiting: surface QR / prompt user, then keep polling
showQrPrompt();
} else throw e;
} Prevention
- Prompt users to scan promptly; reload login.html if the QR expires
- Ensure login occurs in the same browser profile the tool polls
- Verify partitioned cookie settings don't hide sessionid from getCookies
- Close the wait loop once the cookie appears instead of hammering polls
When it happens
Trigger: poll() invoked while the user has not yet scanned the QR code at login.html; QR expired before scanning; user scanned with an account but the session cookie was set on a different domain/profile than the tool watches.
Common situations: Slow QR scanning past the code's expiry; scanning with the wrong WeChat account; browser profile mismatch (login happened in a different profile than the automation watches); user abandoned login.
Related errors
- Waiting for Bilibili session cookies
- huggingface.co
- Waiting for Manus session cookies
- Waiting for WeRead wr_vid cookie
- bilibili.com
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/ceaac477d18e1252.
Report an issue: GitHub.