{"record":{"id":"bf4af730c354b92a","repo":"jackwener/OpenCLI","slug":"error-bf4af7","errorCode":null,"errorMessage":"未找到该候选人","messagePattern":"未找到该候选人","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"clis/boss/invite.js","lineNumber":28,"sourceCode":"    description: 'BOSS直聘发送面试邀请',\n    domain: 'www.zhipin.com',\n    strategy: Strategy.COOKIE,\n    navigateBefore: false,\n    browser: true,\n    args: [\n        { name: 'uid', positional: true, required: true, help: 'Encrypted UID of the candidate' },\n        { name: 'time', required: true, help: 'Interview time (e.g. 2025-04-01 14:00)' },\n        { name: 'address', default: '', help: 'Interview address (uses saved address if empty)' },\n        { name: 'contact', default: '', help: 'Contact person name (uses saved contact if empty)' },\n    ],\n    columns: ['status', 'detail'],\n    func: async (page, kwargs) => {\n        requirePage(page);\n        verbose(`Sending interview invitation to ${kwargs.uid}...`);\n        await navigateToChat(page);\n        const friend = await findFriendByUid(page, kwargs.uid, { checkGreetList: true });\n        if (!friend)\n            throw new Error('未找到该候选人');\n        const friendName = friend.name || '候选人';\n        // Get saved contact info\n        const contactData = await bossFetch(page, 'https://www.zhipin.com/wapi/zpinterview/boss/interview/contactInit', { allowNonZero: true, timeout: 10_000 });\n        const contactName = kwargs.contact || contactData.zpData?.contactName || '';\n        const contactPhone = contactData.zpData?.contactPhone || '';\n        const contactId = contactData.zpData?.contactId || '';\n        // Get saved address\n        const addressData = await bossFetch(page, 'https://www.zhipin.com/wapi/zpinterview/boss/interview/listAddress', { allowNonZero: true, timeout: 10_000 });\n        const savedAddress = addressData.zpData?.list?.[0] || {};\n        const addressText = kwargs.address || savedAddress.cityAddressText || savedAddress.addressText || '';\n        // Parse interview time\n        const interviewTime = new Date(kwargs.time).getTime();\n        if (isNaN(interviewTime)) {\n            throw new Error(`时间格式错误: ${kwargs.time}，请使用格式如 2025-04-01 14:00`);\n        }\n        const params = new URLSearchParams({\n            uid: String(friend.uid),\n            securityId: friend.securityId || '',","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/boss/invite.js#L10-L46","documentation":"`opencli boss invite` sends an interview invitation and, like exchange, requires the candidate to be found via findFriendByUid (chat list + greet list). If not found it throws '未找到该候选人'. You cannot invite a candidate who is not in your current chat/greet lists.","triggerScenarios":"`opencli boss invite <uid> --time ...` with a uid that no longer (or never did) resolves to a friend row: stale/expired uid, deleted chat, candidate not greeted, or list pagination not reaching them.","commonSituations":"Inviting a candidate collected from an old session; uid typo; candidate archived or chat deleted since collection; invite attempted before any greeting exchange occurred.","solutions":["Fetch a fresh uid via `opencli boss recommend` and retry.","Confirm the candidate is in the BOSS chat/greet list in the browser.","Re-check the uid for typos or truncation.","Re-greet the candidate if the conversation was deleted, then retry the invite."],"exampleFix":"// before\nopencli boss invite <expired-uid> --time \"2025-04-01 14:00\"\n// after\nopencli boss recommend\nopencli boss invite <fresh-uid> --time \"2025-04-01 14:00\"","handlingStrategy":"try-catch","validationCode":"const uid = args.uid;\nif (!uid || typeof uid !== 'string' || uid.trim() === '') {\n  throw new Error('uid is required; obtain it from `opencli boss recommend`.');\n}","typeGuard":"function isValidUid(v) {\n  return typeof v === 'string' && v.trim().length > 0;\n}","tryCatchPattern":"try {\n  await run(['opencli', 'boss', 'invite', uid, '--time', t, '--address', addr]);\n} catch (e) {\n  if (e.message.includes('未找到该候选人')) {\n    console.error('Refresh uid via `opencli boss recommend`; candidate must be in chat/greet list.');\n  }\n  throw e;\n}","preventionTips":["Invite only candidates visible in the current chat/greet list.","Refresh uids per session — never cache across logins.","Confirm no chat deletion/archiving happened before inviting.","Validate uid format before calling."],"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"}