jackwener/OpenCLI · error · CommandExecutionError
Unexpected Jike identity probe: ${JSON.stringify(probe)}
Error message
Unexpected Jike identity probe: ${JSON.stringify(probe)} What it means
Defensive CommandExecutionError thrown by requireJikeIdentity when the probe result has no recognized 'kind' and probe.ok is falsy — i.e. page.evaluate returned something unexpected (null, undefined, or a malformed object). The probe is serialized into the message for diagnosis.
Source
Thrown at clis/jike/utils.js:33
headers: { 'x-jike-access-token': token, Accept: 'application/json' },
});
if (r.status === 401 || r.status === 403) return { kind: 'auth', detail: 'Jike users/profile HTTP ' + r.status };
if (!r.ok) return { kind: 'http', httpStatus: r.status };
const d = await r.json();
const u = d && d.user;
if (!u || !u.id) return { kind: 'auth', detail: 'Jike users/profile returned no user (anonymous)' };
return { ok: true, user_id: String(u.id), screen_name: String(u.screenName || ''), username: String(u.username || '') };
} catch (e) {
return { kind: 'exception', detail: String(e && e.message || e) };
}
})()`;
export async function requireJikeIdentity(page) {
const probe = await page.evaluate(JIKE_IDENTITY_PROBE);
if (probe?.kind === 'auth') throw new AuthRequiredError('web.okjike.com', probe.detail);
if (probe?.kind === 'http') throw new CommandExecutionError(`HTTP ${probe.httpStatus} from Jike users/profile`);
if (probe?.kind === 'exception') throw new CommandExecutionError(`Jike identity probe failed: ${probe.detail}`);
if (!probe?.ok) throw new CommandExecutionError(`Unexpected Jike identity probe: ${JSON.stringify(probe)}`);
return { user_id: probe.user_id, screen_name: probe.screen_name, username: probe.username };
}
export function normalizeJikeLimit(raw, defaultValue = 20) {
const limit = raw ?? defaultValue;
if (!Number.isInteger(limit) || limit < 1) {
throw new ArgumentError('--limit must be a positive integer');
}
return limit;
}
export async function postJikeApi(page, path, requestBody, label) {
const url = `https://api.ruguoapp.com${path}`;
const outcome = await page.evaluate(`(async () => {
const token = localStorage.getItem('JK_ACCESS_TOKEN') || '';
const deviceId = localStorage.getItem('JK_DEVICE_ID') || '';
if (!token) return { kind: 'auth', detail: 'Jike access token is missing' };
const headers = {View on GitHub (pinned to 49907e53dc)
Solutions
- Retry the command — null results are often transient races
- Ensure the page remains open and idle while the command executes
- Check browser automation library versions match what the CLI expects
- Report the serialized probe payload in an issue if it reproduces consistently
Defensive patterns
Strategy: retry
Try / catch
try {
const identity = await verifyJikeIdentity(page);
} catch (e) {
if (String(e.message).startsWith('Unexpected Jike identity probe')) {
await sleep(1000);
return verifyJikeIdentity(page); // transient null/abort — retry
}
throw e;
} Prevention
- Keep the page open and idle while identity verification runs
- Retry once before treating it as a hard failure
- Align browser automation library versions with the CLI
- Include the serialized probe payload when reporting persistent issues
When it happens
Trigger: Calling requireJikeIdentity when page.evaluate resolves to null (script aborted by navigation/close), returns undefined, or an object without the expected kind/ok fields due to a browser automation layer change.
Common situations: Browser tab closed or navigated during evaluate; Playwright/Puppeteer version mismatch altering evaluate serialization; a race where the command runs before the probe string executes.
Related errors
- Jike user returned an unreadable payload
- Unexpected 12306 probe: ${JSON.stringify(probe)}
- Waiting for 12306 tk auth cookie
- amazon.com
- Unexpected Amazon probe: ${JSON.stringify(probe)}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/5cca3ca1e747d0a2.
Report an issue: GitHub.