jackwener/OpenCLI · warning · CommandExecutionError

Jike notifications pagination exceeded ${MAX_PAGES} pages be

Error message

Jike notifications pagination exceeded ${MAX_PAGES} pages before satisfying --limit

What it means

listNotifications caps fetching at MAX_PAGES pages. If --limit is not satisfied after MAX_PAGES iterations, it throws CommandExecutionError rather than fetching forever — protecting against unbounded requests when the feed is very large or pagination is broken.

Source

Thrown at clis/jike/notifications.js:123

            rows.push(row);
            if (rows.length >= limit) return rows;
        }
        const next = body.loadMoreKey;
        if (next == null) {
            if (rows.length === 0) throw new EmptyResultError('jike notifications', 'No notifications found');
            return rows;
        }
        if (typeof next !== 'object' || Array.isArray(next)) {
            throw new CommandExecutionError('Jike notifications API returned a malformed pagination cursor');
        }
        const cursorKey = JSON.stringify(next);
        if (seenCursors.has(cursorKey)) {
            throw new CommandExecutionError('Jike notifications pagination returned a repeated cursor');
        }
        seenCursors.add(cursorKey);
        loadMoreKey = next;
    }
    throw new CommandExecutionError(`Jike notifications pagination exceeded ${MAX_PAGES} pages before satisfying --limit`);
}

cli({
    site: 'jike',
    name: 'notifications',
    access: 'read',
    description: '即刻通知',
    domain: 'web.okjike.com',
    strategy: Strategy.COOKIE,
    browser: true,
    args: [
        { name: 'limit', type: 'int', default: DEFAULT_LIMIT },
    ],
    columns: ['type', 'user', 'content', 'time'],
    func: async (page, kwargs) => {
        const limit = normalizeJikeLimit(kwargs.limit, DEFAULT_LIMIT);
        await page.goto('https://web.okjike.com/notification');
        await requireJikeIdentity(page);

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Lower the --limit value to something reachable within MAX_PAGES pages
  2. Increase MAX_PAGES/PAGE_SIZE in the CLI config or source if you genuinely need more
  3. Run the command incrementally (smaller limits repeatedly) to page through the feed
  4. Check whether pagination is degraded (tiny pages) — see the repeated-cursor / malformed-cursor errors

Example fix

// before
jike notifications --limit 1000
// after
jike notifications --limit 50
Defensive patterns

Strategy: validation

Validate before calling

// keep the requested limit within what MAX_PAGES*PAGE_SIZE can deliver
const MAX_PAGES = 10, PAGE_SIZE = 20; // confirm actual values in the CLI
if (limit > MAX_PAGES * PAGE_SIZE) {
  throw new Error(`--limit ${limit} exceeds pagination cap ${MAX_PAGES * PAGE_SIZE}`);
}

Try / catch

try {
  await cli('jike', 'notifications', ['--limit', '50']).run();
} catch (e) {
  if (String(e.message).includes('pagination exceeded')) {
    // fall back to the maximum achievable page count or fetch incrementally
  } else throw e;
}

Prevention

When it happens

Trigger: Calling `jike notifications` with a --limit larger than MAX_PAGES * PAGE_SIZE, or pagination stalling (small/empty pages) so the limit is never reached within the page cap.

Common situations: Requesting notifications for a very active account with a large --limit; a server-side page size reduction making MAX_PAGES insufficient; broken cursors yielding tiny pages.

Related errors


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