{"record":{"id":"0bd999198a7c0322","repo":"jackwener/OpenCLI","slug":"error-0bd999","errorCode":null,"errorMessage":"找不到消息输入框","messagePattern":"找不到消息输入框","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"clis/boss/greet.js","lineNumber":44,"sourceCode":"        // 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":26,"sourceCodeEnd":50,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/boss/greet.js#L26-L50","documentation":"After clicking the candidate in `opencli boss greet`, typeAndSendMessage must locate the message input box in the chat panel. If it cannot find or use the input (returns falsy), the command throws '找不到消息输入框'. This usually means the chat panel did not open/render after the click.","triggerScenarios":"The candidate row was clicked but the chat panel failed to load (slow network/render), the clicked conversation is not actually open, or BOSS changed the chat input DOM so the selectors no longer match.","commonSituations":"Page still loading after click (only 2s wait); a modal/interstitial (login, verification) covering the chat; candidate's conversation failed to open because the session is stale.","solutions":["Re-run the command — transient render delay is the most common cause.","Open the browser and confirm the chat panel opens when clicking the candidate manually.","Log in again if a verification/login modal intercepts the UI.","Increase tolerance by re-running with a faster network or after the page fully loads; check for BOSS DOM changes if it persists."],"exampleFix":"// before\nopencli boss greet <uid>   # fails intermittently on slow render\n// after\nopencli boss greet <uid>   # retry after confirming chat panel opens in browser","handlingStrategy":"retry","validationCode":"// No pre-call validation applies; mitigate with slower pacing:\n// ensure previous command finished and page settled before greeting.\nawait sleep(3000); // allow chat panel render budget","typeGuard":null,"tryCatchPattern":"try {\n  await run(['opencli', 'boss', 'greet', uid, '--text', msg]);\n} catch (e) {\n  if (e.message.includes('找不到消息输入框')) {\n    await sleep(3000);\n    return run(['opencli', 'boss', 'greet', uid, '--text', msg]); // retry once\n  }\n  throw e;\n}","preventionTips":["Retry after a delay — the chat panel often needs more render time.","Check for login/verification modals blocking the chat UI.","Verify the chat panel opens manually when clicking the candidate.","Report persistent failures as possible BOSS DOM selector changes."],"tags":["dom-selector","boss","chat-input","ui-automation"],"backgroundTag":"element-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}