jackwener/OpenCLI · info · EmptyResultError

No recruiter-side chat sessions were returned.

Error message

No recruiter-side chat sessions were returned.

What it means

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.

Source

Thrown at clis/boss/chatlist.js:82

        { name: 'limit', type: 'int', default: 20, help: 'Number of results' },
        { name: 'job-id', default: '0', help: 'Filter by job ID (0=all, boss side only)' },
        { name: 'side', default: 'auto', choices: ['auto', 'boss', 'geek'], help: 'Identity side: auto (default), boss (recruiter), or geek (job-seeker)' },
    ],
    columns: ['name', 'company', 'job', 'title', 'last_msg', 'last_time', 'uid', 'security_id'],
    func: async (page, kwargs) => {
        requirePage(page);
        const limit = readPositiveInteger(kwargs.limit, 'chatlist --limit', 20, 100);
        const pageNum = readPositiveInteger(kwargs.page, 'chatlist --page', 1);
        const side = kwargs.side || 'auto';

        if (side === 'boss') {
            await navigateToChat(page);
            const friends = await fetchFriendList(page, {
                pageNum,
                jobId: kwargs['job-id'] || '0',
            });
            if (friends.length === 0)
                throw new EmptyResultError('boss chatlist', 'No recruiter-side chat sessions were returned.');
            return friends.slice(0, limit).map(mapBossRow);
        }

        if (side === 'geek') {
            await navigateToGeekChat(page);
            const rows = await buildGeekRows(page, limit);
            if (rows.length === 0)
                throw new EmptyResultError('boss chatlist', 'No job-seeker-side chat sessions were returned.');
            return rows;
        }

        // auto: try recruiter first, fall back to geek on identity mismatch
        await navigateToChat(page);
        const bossResult = await fetchFriendList(page, {
            pageNum,
            jobId: kwargs['job-id'] || '0',
            allowNonZero: true,
        });

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Remove --job-id (use 0=all) or pick a job that has applicants, and set --page 1
  2. Drop --side boss and use --side auto so the command falls back appropriately
  3. Verify in the zhipin.com web UI that the recruiter inbox actually shows conversations on the same filters
  4. If the UI shows chats but the CLI returns empty, check fetchFriendList request payload/version in clis/boss/utils.js for API drift

Example fix

// before
boss chatlist --side boss --job-id 12345  // EmptyResultError
// after
boss chatlist --side boss --job-id 0 --page 1
Defensive patterns

Strategy: fallback

Validate before calling

// Pre-check filters that commonly empty recruiter results
if (opts.side === 'boss' && opts.jobId && opts.jobId !== '0') {
  console.warn('job-id filter may return 0 chats; use 0 for all jobs');
}
if (Number(opts.page) > 1) console.warn('page > 1 often has no rows');

Type guard

function isNonEmptyFriendList(v) {
  return Array.isArray(v) && v.length > 0;
}

Try / catch

try {
  rows = await bossChatlist({ side: 'boss', jobId, page });
} catch (err) {
  if (err instanceof EmptyResultError && err.message.includes('recruiter-side')) {
    return []; // legitimately empty inbox; not a failure
  }
  throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/ced90ef699dedbe3. Report an issue: GitHub.