{"record":{"id":"0943c405dd2042ee","repo":"jackwener/OpenCLI","slug":"geek","errorCode":null,"errorMessage":"未找到该聊天（geek 侧）","messagePattern":"未找到该聊天（geek 侧）","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/boss/chatmsg.js","lineNumber":59,"sourceCode":"    if (!friend) throw new EmptyResultError('boss chatmsg', '未找到该候选人');\n    if (!friend.securityId) throw new CommandExecutionError('该聊天缺少 securityId，无法获取历史消息');\n    const gid = friend.uid;\n    const securityId = encodeURIComponent(friend.securityId);\n    const msgUrl = `https://www.zhipin.com/wapi/zpchat/boss/historyMsg?gid=${gid}&securityId=${securityId}&page=${kwargs.page}&c=20&src=0`;\n    const msgData = await bossFetch(page, msgUrl);\n    const messages = msgData.zpData?.messages ?? msgData.zpData?.historyMsgList;\n    if (!Array.isArray(messages)) {\n        throw new CommandExecutionError('Boss recruiter history response did not include a message list');\n    }\n    if (messages.length === 0) {\n        throw new EmptyResultError('boss chatmsg', 'Boss returned no messages for this chat.');\n    }\n    return messages.map((m) => mapBossMsg(m, friend));\n}\n\nasync function geekChatMsg(page, kwargs, encryptSystemId) {\n    const friend = await findGeekFriendByUid(page, kwargs.uid, { encryptSystemId });\n    if (!friend) throw new EmptyResultError('boss chatmsg', '未找到该聊天（geek 侧）');\n    if (!friend.securityId) throw new CommandExecutionError('该聊天缺少 securityId，无法获取历史消息');\n    const messages = await fetchGeekHistoryMsg(page, friend, { page: kwargs.page });\n    return messages.map((m) => mapGeekMsg(m, friend));\n}\n\ncli({\n    site: 'boss',\n    name: 'chatmsg',\n    access: 'read',\n    description: 'BOSS直聘查看聊天消息历史（招聘端/求职端）',\n    domain: 'www.zhipin.com',\n    strategy: Strategy.COOKIE,\n    navigateBefore: false,\n    browser: true,\n    args: [\n        { name: 'uid', required: true, positional: true, help: 'Encrypted UID (from chatlist)' },\n        { name: 'page', type: 'int', default: 1, help: 'Page number' },\n        { name: 'side', default: 'auto', choices: ['auto', 'boss', 'geek'], help: 'Identity side: auto (default), boss (recruiter), or geek (job-seeker)' },","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/boss/chatmsg.js#L41-L77","documentation":"geekChatMsg throws EmptyResultError('boss chatmsg', '未找到该聊天（geek 侧）') when findGeekFriendByUid cannot locate the uid in the job-seeker's (geek) chat list. The library throws because it needs the geek-side friend record (securityId) to fetch history; with no match it returns nothing rather than guessing. Side-specific variant of the candidate-not-found error.","triggerScenarios":"Calling `boss chatmsg <uid> --side geek` where the uid exists only on the recruiter (boss) side or not at all; the conversation was deleted from the job-seeker account; the encrypted uid belongs to a different account.","commonSituations":"Forcing --side geek for a recruiter-owned conversation; uid copied from a boss-side chatlist run; job-seeker account not logged in or switched, so the list is empty; conversation expired/archived on the geek side.","solutions":["Re-run without --side (auto): the command tries the recruiter side first and only falls back to geek.","Re-run `opencli boss chatlist` for the geek account and use a uid from that output.","Confirm the geek account is logged in and the conversation still exists in the BOSS web UI.","Verify the uid string is the full encrypted value from chatlist (no truncation or whitespace).","If you meant the recruiter side, use --side boss instead."],"exampleFix":"// before\nopencli boss chatmsg 0x91fe --side geek\n// after\nopencli boss chatmsg 0x91fe   // auto: boss side first, geek fallback","handlingStrategy":"try-catch","validationCode":"// confirm the uid exists on the geek side before forcing --side geek\nconst geekList = await chatlist({ side: 'geek' });\nif (!geekList.some(f => f.uid === uid)) throw new Error('uid not on geek side');","typeGuard":"function isFriend(f) { return !!f && typeof f === 'object' && typeof f.uid === 'string' && f.uid.length > 0; }","tryCatchPattern":"try {\n  const msgs = await chatmsg(uid, { side: 'geek' });\n} catch (e) {\n  if (isEmptyResultError(e)) return chatmsg(uid, { side: 'auto' }); // search boss side too\n  throw e;\n}","preventionTips":["Use side=auto unless you know the uid's side for certain.","Source uids from the chatlist run of the same account/side you query.","Confirm the geek session is logged in and the conversation still exists.","Quote the encrypted uid in the shell."],"tags":["empty-result","boss-zhipin","geek-side","lookup-failed"],"backgroundTag":"chat-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}