jackwener/OpenCLI · error · CommandExecutionError
Unexpected Boss probe: ${JSON.stringify(probe)}
Error message
Unexpected Boss probe: ${JSON.stringify(probe)} What it means
After probing the page, verifyBossIdentity expects the evaluate result to be either {kind:'auth',...} or {ok:true,...}. If probe is undefined, malformed, or otherwise lacks both fields, it throws CommandExecutionError 'Unexpected Boss probe: <JSON>'. This guards against a broken probe result rather than a normal unauthenticated state — e.g. the page script failed to run or returned something unexpected.
Source
Thrown at clis/boss/auth.js:33
throw new AuthRequiredError('zhipin.com', 'Boss wt2 / t cookies missing');
}
await page.goto(BOSS_GEEK_JOBS_URL);
await page.wait(3);
const probe = await page.evaluate(`
(() => {
const path = location.pathname || '';
if (/\\/web\\/user\\/login|\\/login\\.html/.test(location.href)) {
return { kind: 'auth', detail: 'Boss redirected to login page' };
}
const userType = /\\/web\\/geek\\//.test(path) ? 'geek' : /\\/web\\/(boss|recruit|chat\\/boss)/.test(path) ? 'recruiter' : '';
if (!userType) {
return { kind: 'auth', detail: 'Boss path does not look like authenticated geek/recruiter page: ' + path };
}
return { ok: true, user_type: userType };
})()
`);
if (probe?.kind === 'auth') throw new AuthRequiredError('zhipin.com', probe.detail);
if (!probe?.ok) throw new CommandExecutionError(`Unexpected Boss probe: ${JSON.stringify(probe)}`);
return { user_type: probe.user_type };
}
registerSiteAuthCommands({
site: 'boss',
domain: 'zhipin.com',
loginUrl: 'https://login.zhipin.com/',
columns: ['user_type'],
quickCheck: hasBossSessionCookie,
verify: verifyBossIdentity,
poll: async (page) => {
if (!await hasBossSessionCookie(page)) {
throw new AuthRequiredError('zhipin.com', 'Waiting for Boss wt2 / t cookies');
}
return verifyBossIdentity(page);
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Read the JSON in the error message to see what the probe actually returned and diagnose from that shape
- Increase the post-navigation wait (page.wait) so the SPA finishes rendering before probing
- Re-run the command; transient navigations or dialogs can swallow the probe result
- Check whether zhipin.com served an error/waf interstitial page and switch IP/profile if so
- If the driver wraps evaluate results, adjust the probe invocation to unwrap before returning
Example fix
// before
const probe = await page.evaluate(`(() => { ... })()`);
// after
await page.waitForSelector('.page-jobs, [ka="header-logo"]', { timeout: 10000 }).catch(() => {});
const probe = await page.evaluate(`(() => { try { ... } catch (e) { return { kind: 'probe-error', detail: String(e) }; } })()`); Defensive patterns
Strategy: try-catch
Validate before calling
// Ensure the SPA is interactive before probing
await page.goto('https://www.zhipin.com/web/geek/jobs');
await page.waitForLoadState?.('networkidle').catch(() => {});
if (!/\/web\/(geek|boss|recruit|chat\/boss)/.test(new URL(page.url()).pathname)) {
// not on an authenticated path; login/probe will be meaningless
console.warn('unexpected landing path:', page.url());
} Type guard
function isWellFormedProbe(probe) {
return probe !== null && typeof probe === 'object' &&
(probe.kind === 'auth' || probe.ok === true);
} Try / catch
try {
const identity = await bossVerify(page);
} catch (err) {
if (err instanceof CommandExecutionError && err.message.startsWith('Unexpected Boss probe')) {
// parse the JSON after the prefix to see what actually came back
const raw = err.message.slice('Unexpected Boss probe: '.length);
console.error('probe result:', raw);
// retry once after a longer wait
await page.waitForTimeout(3000);
return bossVerify(page);
}
throw err;
} Prevention
- Allow sufficient settle time after navigation before running in-page probes
- Keep the probe IIFE defensive: wrap in try/catch and always return a tagged object
- Handle dialogs/overlays that can block script execution on zhipin.com pages
- Update the adapter when zhipin.com SPA routing changes paths like /web/geek/
When it happens
Trigger: page.evaluate returns null/undefined (script blocked by CSP, page navigated away mid-probe, dialog intercepted), or returns an object without kind==='auth' and without ok:true (e.g. {ok:false}, a serialized error, or a different runtime shape).
Common situations: Page still loading SPA shell so the probe IIFE threw and the harness swallowed the result; automation browser injecting wrappers that change the return serialization; zhipin.com serving an error/interstitial page instead of the app; driver version returning wrapped evaluate results.
Related errors
- Unexpected Chaoxing probe: ${JSON.stringify(probe)}
- Unexpected Doubao probe: ${JSON.stringify(result)}
- Unexpected Dribbble identity response: ${JSON.stringify(resu
- Failed to read facebook search results: ${err instanceof Err
- Unexpected JD probe: ${JSON.stringify(probe)}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/64b60a099021f350.
Report an issue: GitHub.