{"record":{"id":"2e99805a6ede26f3","repo":"jackwener/OpenCLI","slug":"xueqiu-comments-pagination-stopped-after-request-2e9980","errorCode":null,"errorMessage":"xueqiu comments pagination stopped after request ${requestNumber}, collected ${collected}/${target} items, reason: reached safety cap","messagePattern":"xueqiu comments pagination stopped after request (.+?), collected (.+?)/(.+?) items, reason: reached safety cap","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"clis/xueqiu/comments.js","lineNumber":292,"sourceCode":"        for (const row of pageRows) {\n            if (seenIds.has(row.id))\n                continue;\n            seenIds.add(row.id);\n            rows.push(row);\n            advanced = true;\n        }\n        if (rows.length >= options.limit) {\n            return rows.slice(0, options.limit);\n        }\n        if (rawItems.length < options.pageSize) {\n            break;\n        }\n        if (!advanced) {\n            warn(buildPaginationStopMessage(requestNumber, rows.length, options.limit, 'pagination did not advance'));\n            break;\n        }\n        if (requestNumber === options.maxRequests) {\n            warn(buildPaginationStopMessage(requestNumber, rows.length, options.limit, 'reached safety cap'));\n        }\n    }\n    return rows.slice(0, options.limit);\n}\ncli({\n    site: 'xueqiu',\n    name: 'comments',\n    access: 'read',\n    description: '获取单只股票的讨论动态',\n    domain: 'xueqiu.com',\n    strategy: Strategy.COOKIE,\n    browser: true,\n    navigateBefore: false,\n    args: [\n        {\n            name: 'symbol',\n            positional: true,\n            required: true,","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/xueqiu/comments.js#L274-L310","documentation":"A warning emitted when the collector hits options.maxRequests — the hard safety cap on how many page requests may be issued — before collecting options.limit items. It exists to bound runtime and request volume against the site.","triggerScenarios":"Requesting more comments than maxRequests * pageSize, e.g. --limit 1000 with a 20-item pageSize and maxRequests of 30, or a slow-yielding thread requiring more pages than the cap allows.","commonSituations":"Users asking for very large comment exports; long-running hot threads; small pageSize combined with a large limit.","solutions":["Lower --limit to a value achievable within the safety cap","Raise options.maxRequests if more requests are acceptable","Increase --page-size to collect more per request","Run the command repeatedly with offset handling if the CLI supports it"],"exampleFix":"// before\nclis/xueqiu/comments.js --limit 1000  // maxRequests=30, pageSize=20 -> caps at 600\n// after\nclis/xueqiu/comments.js --limit 500    // fits within cap","handlingStrategy":"validation","validationCode":"if (limit > maxRequests * pageSize) throw new Error(`limit ${limit} exceeds cap ${maxRequests * pageSize}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Compute limit as maxRequests * pageSize before invoking","Raise maxRequests deliberately when large exports are needed","Prefer bigger pageSize over more requests"],"tags":["pagination","safety-cap","scraping"],"backgroundTag":"pagination-stopped-early","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}