{"record":{"id":"65d0792a53dfa4c0","repo":"jackwener/OpenCLI","slug":"uid","errorCode":null,"errorMessage":"uid 在招聘端与求职端聊天列表中均未找到","messagePattern":"uid 在招聘端与求职端聊天列表中均未找到","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/boss/chatmsg.js","lineNumber":112,"sourceCode":"            const encryptSystemId = await readEncryptSystemId(page);\n            return await geekChatMsg(page, normalizedKwargs, encryptSystemId);\n        }\n\n        // auto: try recruiter first, fall back to geek when not found or identity mismatch\n        await navigateToChat(page);\n        const bossResult = await findFriendByUid(page, uid, { allowNonZero: true });\n        if (bossResult?.friend) {\n            return await bossChatMsg(page, normalizedKwargs, bossResult.friend);\n        }\n        // Not found or identity mismatch — check for hard errors before falling back\n        if (bossResult?.code && bossResult.code !== 0 && bossResult.code !== IDENTITY_MISMATCH_CODE) {\n            assertOk(bossResult);\n        }\n        // Fall back to geek side\n        await navigateToGeekChat(page);\n        const encryptSystemId = await readEncryptSystemId(page);\n        const geekFriend = await findGeekFriendByUid(page, uid, { encryptSystemId });\n        if (!geekFriend) throw new EmptyResultError('boss chatmsg', 'uid 在招聘端与求职端聊天列表中均未找到');\n        if (!geekFriend.securityId) throw new CommandExecutionError('该聊天缺少 securityId，无法获取历史消息');\n        const messages = await fetchGeekHistoryMsg(page, geekFriend, { page: pageNum });\n        return messages.map((m) => mapGeekMsg(m, geekFriend));\n    },\n});\n","sourceCodeStart":94,"sourceCodeEnd":118,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/boss/chatmsg.js#L94-L118","documentation":"In the chatmsg command's auto mode, this EmptyResultError('uid 在招聘端与求职端聊天列表中均未找到') is thrown only after both lookups fail: findFriendByUid on the recruiter side returned nothing (or only an identity-mismatch code), and the fallback findGeekByUid on the job-seeker side also found no match. It definitively means the uid is not in any chat list visible to the current session on either side.","triggerScenarios":"`boss chatmsg <uid>` (auto) with a uid that matches no conversation in either the recruiter's or the job-seeker's chat list — invalid/stale/foreign uid, empty chat list due to missing login, or both accounts lack the conversation.","commonSituations":"uid from an old chatlist run after the conversation was deleted; uid belongs to a different BOSS account entirely; both sessions logged out so chat lists render empty; typos or shell-mangled encrypted uid (special characters like + or = not quoted).","solutions":["Re-run `opencli boss chatlist` (and the geek-side equivalent) and copy the uid fresh from the output.","Quote the uid in your shell: encrypted values can contain characters shells interpret (e.g. `opencli boss chatmsg '0xAbC+123'`).","Verify both boss and geek sessions are logged in (run a simple command like `opencli boss whoami` / refresh cookies).","Confirm the conversation still exists in the BOSS web UI on at least one side.","If the uid came from another tool/older export, it may be stale — regenerate it from the current chatlist."],"exampleFix":"// before\nopencli boss chatmsg 0x9k+2/dQ==   # shell eats + and /\n// after\nopencli boss chatmsg '0x9k+2/dQ==' # quoted, complete encrypted uid","handlingStrategy":"validation","validationCode":"// resolve the uid from the live chatlist before calling chatmsg\nconst all = [...await chatlist({}), ...await chatlist({ side: 'geek' })];\nconst match = all.find(f => f.uid === uid);\nif (!match) throw new Error(`uid ${uid} absent from both sides — refresh chatlist`);","typeGuard":"function isKnownUid(uid, lists) { return lists.flat().some(f => f.uid === uid); }","tryCatchPattern":"try {\n  const msgs = await chatmsg(uid);\n} catch (e) {\n  if (isEmptyResultError(e) && /均未找到/.test(e.message)) {\n    // refresh uid from a new chatlist run, or report unknown uid\n    throw new Error(`stale/unknown uid: ${uid}`);\n  }\n  throw e;\n}","preventionTips":["Regenerate uids from a fresh chatlist before each batch of chatmsg calls.","Treat uids as ephemeral: never cache them across sessions.","Quote uids in the shell; verify sessions on both sides are authenticated.","Confirm the conversation exists in the web UI when a uid unexpectedly fails."],"tags":["empty-result","boss-zhipin","lookup-failed","chat-list"],"backgroundTag":"chat-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}