{"record":{"id":"ced90ef699dedbe3","repo":"jackwener/OpenCLI","slug":"no-recruiter-side-chat-sessions-were-returned","errorCode":null,"errorMessage":"No recruiter-side chat sessions were returned.","messagePattern":"No recruiter-side chat sessions were returned\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"info","filePath":"clis/boss/chatlist.js","lineNumber":82,"sourceCode":"        { name: 'limit', type: 'int', default: 20, help: 'Number of results' },\n        { name: 'job-id', default: '0', help: 'Filter by job ID (0=all, boss side only)' },\n        { name: 'side', default: 'auto', choices: ['auto', 'boss', 'geek'], help: 'Identity side: auto (default), boss (recruiter), or geek (job-seeker)' },\n    ],\n    columns: ['name', 'company', 'job', 'title', 'last_msg', 'last_time', 'uid', 'security_id'],\n    func: async (page, kwargs) => {\n        requirePage(page);\n        const limit = readPositiveInteger(kwargs.limit, 'chatlist --limit', 20, 100);\n        const pageNum = readPositiveInteger(kwargs.page, 'chatlist --page', 1);\n        const side = kwargs.side || 'auto';\n\n        if (side === 'boss') {\n            await navigateToChat(page);\n            const friends = await fetchFriendList(page, {\n                pageNum,\n                jobId: kwargs['job-id'] || '0',\n            });\n            if (friends.length === 0)\n                throw new EmptyResultError('boss chatlist', 'No recruiter-side chat sessions were returned.');\n            return friends.slice(0, limit).map(mapBossRow);\n        }\n\n        if (side === 'geek') {\n            await navigateToGeekChat(page);\n            const rows = await buildGeekRows(page, limit);\n            if (rows.length === 0)\n                throw new EmptyResultError('boss chatlist', 'No job-seeker-side chat sessions were returned.');\n            return rows;\n        }\n\n        // auto: try recruiter first, fall back to geek on identity mismatch\n        await navigateToChat(page);\n        const bossResult = await fetchFriendList(page, {\n            pageNum,\n            jobId: kwargs['job-id'] || '0',\n            allowNonZero: true,\n        });","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/boss/chatlist.js#L64-L100","documentation":"When side=boss is requested, chatlist navigates to the recruiter chat page and calls fetchFriendList; if the returned array is empty it throws EmptyResultError('boss chatlist'). This means the authenticated identity is a recruiter and the API call succeeded, but zero chat sessions came back (or none for the given job/page). The library treats an explicit empty list as a structured empty result rather than silently returning nothing.","triggerScenarios":"Running `boss chatlist --side boss` (or auto where the account is recruiter-side) when the recruiter account has no conversations, the --job-id filter matches a job with no applicants/chats, or --page exceeds the number of available pages.","commonSituations":"New recruiter account with no messages yet; filtering by --job-id of a job nobody has applied to; requesting page 5 when only 2 pages exist; conversations exist only on the geek side of the same account.","solutions":["Remove --job-id (use 0=all) or pick a job that has applicants, and set --page 1","Drop --side boss and use --side auto so the command falls back appropriately","Verify in the zhipin.com web UI that the recruiter inbox actually shows conversations on the same filters","If the UI shows chats but the CLI returns empty, check fetchFriendList request payload/version in clis/boss/utils.js for API drift"],"exampleFix":"// before\nboss chatlist --side boss --job-id 12345  // EmptyResultError\n// after\nboss chatlist --side boss --job-id 0 --page 1","handlingStrategy":"fallback","validationCode":"// Pre-check filters that commonly empty recruiter results\nif (opts.side === 'boss' && opts.jobId && opts.jobId !== '0') {\n  console.warn('job-id filter may return 0 chats; use 0 for all jobs');\n}\nif (Number(opts.page) > 1) console.warn('page > 1 often has no rows');","typeGuard":"function isNonEmptyFriendList(v) {\n  return Array.isArray(v) && v.length > 0;\n}","tryCatchPattern":"try {\n  rows = await bossChatlist({ side: 'boss', jobId, page });\n} catch (err) {\n  if (err instanceof EmptyResultError && err.message.includes('recruiter-side')) {\n    return []; // legitimately empty inbox; not a failure\n  }\n  throw err;\n}","preventionTips":["Default to --job-id 0 and --page 1 when exploring an account","Use --side auto unless you are certain of the account type","Cross-check the recruiter web inbox when results are empty and filters are loose","Handle EmptyResultError distinctly from hard errors in batch scripts"],"tags":["empty-result","chatlist","pagination","zhipin"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}