jackwener/OpenCLI · error · Error
无法在聊天列表中找到该用户,请确认聊天列表中有此人
Error message
无法在聊天列表中找到该用户,请确认聊天列表中有此人
What it means
Thrown by the boss resume command when findFriendByUid found the candidate record by uid but clickCandidateInList could not locate and click that user in the visible chat list. The library throws because the right-panel resume scraper needs the candidate's chat opened first; without the click there is no resume panel to scrape. It is a UI-state error, not a data error.
Source
Thrown at clis/boss/resume.js:40
browser: true,
args: [
{ name: 'uid', required: true, positional: true, help: 'Encrypted UID of the candidate (from chatlist)' },
],
columns: [
'name', 'gender', 'age', 'experience', 'degree', 'active_time',
'work_history', 'education',
'job_chatting', 'expect',
],
func: async (page, kwargs) => {
requirePage(page);
await navigateToChat(page, 3);
const friend = await findFriendByUid(page, kwargs.uid, { maxPages: 5 });
if (!friend)
throw new Error('未找到该候选人,请确认 uid 是否正确');
const numericUid = friend.uid;
const clicked = await clickCandidateInList(page, numericUid);
if (!clicked) {
throw new Error('无法在聊天列表中找到该用户,请确认聊天列表中有此人');
}
await page.wait({ time: 2 });
// Scrape the right panel
const resumeInfo = await page.evaluate(`
(() => {
const container = document.querySelector('.base-info-single-container') || document.querySelector('.base-info-content');
if (!container) return { error: 'no container found' };
const nameEl = container.querySelector('.base-name');
const name = nameEl ? nameEl.textContent.trim() : '';
let gender = '';
const detailDiv = container.querySelector('.base-info-single-detial');
if (detailDiv) {
const uses = detailDiv.querySelectorAll('use');
for (const u of uses) {
const href = u.getAttribute('xlink:href') || u.getAttribute('href') || '';
if (href.includes('icon-men')) { gender = '男'; break; }View on GitHub (pinned to 49907e53dc)
Solutions
- Confirm an actual chat/conversation exists with that candidate in the BOSS web app; resume scraping requires it
- Send the candidate a message first (or use boss send) so they appear in the chat list, then retry
- Verify the uid with findFriendByUid / candidate search and use the exact uid returned
- Increase scrolling coverage (the helper scans up to maxPages: 5) by checking manually whether the candidate is deeper in the list
- Re-check that the account is logged in and the chat list is fully rendered before running
Example fix
// before: scraping resume for a uid with no conversation
await cli('boss', 'resume', { uid: '12345678' });
// after: ensure conversation exists first, then scrape
const friend = await findFriendByUid(page, uid, { maxPages: 5 });
if (!friend) throw new Error('uid not found');
if (!await clickCandidateInList(page, friend.uid)) {
// open chat programmatically or message the candidate first
await navigateToChat(page, 3);
await sendMessage(page, uid, 'hello');
}
const resume = await cli('boss', 'resume', { uid }); Defensive patterns
Strategy: validation
Validate before calling
const friend = await findFriendByUid(page, uid, { maxPages: 5 });
if (!friend) throw new Error(`uid ${uid} not found; check the uid`);
// optionally pre-check the chat list contains friend.uid before invoking resume Type guard
function canClick(friend) {
return Boolean(friend && typeof friend.uid === 'string' && friend.uid.length > 0);
} Try / catch
try {
const resume = await cli('boss', 'resume', { uid });
} catch (e) {
if (String(e.message).includes('无法在聊天列表中找到该用户')) {
// ensure conversation exists (send a message) or skip candidate
return null;
}
throw e;
} Prevention
- Only scrape resumes for candidates you have an open conversation with
- Freshly resolve uids with findFriendByUid instead of caching
- Manually verify the chat list in the browser when a uid fails
- Handle missing candidates gracefully in batch scripts
When it happens
Trigger: Calling boss resume with a uid that resolves in the friend index but whose chat entry is not present in the loaded chat list (list not scrolled to that entry, chat never initiated with that candidate, or candidate no longer appears in the conversation list).
Common situations: Developers resume-scraping a candidate who was contacted long ago and fell off the first pages of the chat list; candidates whose conversation was deleted; stale uids reused after the recruiter account changed; the chat list being filtered or still loading when the click is attempted.
Related errors
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/86f412e6294e6d5a.
Report an issue: GitHub.