{"record":{"id":"bacd2fa724afed90","repo":"jackwener/OpenCLI","slug":"uid-recommend","errorCode":null,"errorMessage":"未找到该候选人，请确认 uid 是否正确（可从 recommend 命令获取）","messagePattern":"未找到该候选人，请确认 uid 是否正确（可从 recommend 命令获取）","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"clis/boss/greet.js","lineNumber":32,"sourceCode":"    browser: true,\n    args: [\n        { name: 'uid', positional: true, required: true, help: 'Encrypted UID of the candidate (from recommend)' },\n        { name: 'security-id', required: true, help: 'Security ID of the candidate' },\n        { name: 'job-id', required: true, help: 'Encrypted job ID' },\n        { name: 'text', default: '', help: 'Custom greeting message (uses default template if empty)' },\n    ],\n    columns: ['status', 'detail'],\n    func: async (page, kwargs) => {\n        requirePage(page);\n        verbose(`Greeting candidate ${kwargs.uid}...`);\n        await navigateToChat(page, 3);\n        // Find candidate in greet list or friend list\n        const friend = await findFriendByUid(page, kwargs.uid, {\n            maxPages: 1,\n            checkGreetList: true,\n        });\n        if (!friend) {\n            throw new Error('未找到该候选人，请确认 uid 是否正确（可从 recommend 命令获取）');\n        }\n        const numericUid = friend.uid;\n        const friendName = friend.name || '候选人';\n        const clicked = await clickCandidateInList(page, numericUid);\n        if (!clicked) {\n            throw new Error('无法在聊天列表中找到该用户，候选人可能不在当前列表中');\n        }\n        await page.wait({ time: 2 });\n        const msgText = kwargs.text || '你好，请问您对这个职位感兴趣吗？';\n        const sent = await typeAndSendMessage(page, msgText);\n        if (!sent) {\n            throw new Error('找不到消息输入框');\n        }\n        await page.wait({ time: 1 });\n        return [{ status: '✅ 招呼已发送', detail: `已向 ${friendName} 发送: ${msgText}` }];\n    },\n});\n","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/boss/greet.js#L14-L50","documentation":"`opencli boss greet` looks up the candidate once (single page, checkGreetList: true) and throws this Chinese error if findFriendByUid returns nothing. Unlike exchange, greet limits the scan to one page, so the candidate must be near the top of the chat/greet list. The message points users to the `recommend` command as the source of valid uids.","triggerScenarios":"`opencli boss greet <uid>` with a uid absent from the first page of the chat list and the greet list — stale uid, typo, or candidate buried below page one of the list.","commonSituations":"Greeting a candidate whose chat is older than the first list page; uid from a previous session after BOSS re-encrypted ids; misspelled uid; calling greet on someone never contacted (no greet-list entry).","solutions":["Get a fresh uid via `opencli boss recommend` and retry immediately.","Verify the candidate is visible in the first page of the BOSS chat list in the browser.","Re-check the uid string for typos or truncation.","If the candidate is deeper in the list, use `resume` (maxPages: 5) first or re-greet from the recommend flow to bring them to the top."],"exampleFix":"// before\nopencli boss greet <old-uid-from-last-week>\n// after\nopencli boss recommend          # fresh uid from greet list\nopencli boss greet <fresh-uid> --text \"你好...\"","handlingStrategy":"try-catch","validationCode":"const uid = args.uid;\nif (!uid || typeof uid !== 'string') {\n  throw new Error('uid is required; obtain it from `opencli boss recommend`.');\n}","typeGuard":"function isNonEmptyString(v) {\n  return typeof v === 'string' && v.trim().length > 0;\n}","tryCatchPattern":"try {\n  await run(['opencli', 'boss', 'greet', uid]);\n} catch (e) {\n  if (e.message.includes('未找到该候选人')) {\n    console.error('Greet scans only one list page — refresh uid via `opencli boss recommend` and retry.');\n  }\n  throw e;\n}","preventionTips":["Greet soon after `recommend` so the candidate is on page one of the list.","Keep uids in a pipeline straight from recommend output.","Confirm candidate presence in the greet list before greeting.","Watch for BOSS uid re-encryption between sessions and refresh uids."],"tags":["candidate-not-found","boss","chat-list"],"backgroundTag":"entity-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}