jackwener/OpenCLI · error · CommandExecutionError
Unexpected response while loading xueqiu comments for ${symb
Error message
Unexpected response while loading xueqiu comments for ${symbol} What it means
Catch-all branch of throwFirstPageFailure: when the first comments page is classified 'incompatible' (JSON content type but no recognizable list shape) it falls through to CommandExecutionError 'Unexpected response while loading xueqiu comments for <symbol>' with the hint to re-run with --verbose. It means xueqiu answered with JSON that does not match the expected envelope, i.e. an API shape change or an unrecognized error payload.
Source
Thrown at clis/xueqiu/comments.js:53
return String(value);
return '';
}
function buildPaginationStopMessage(requestNumber, collected, target, reason) {
return `xueqiu comments pagination stopped after request ${requestNumber}, `
+ `collected ${collected}/${target} items, `
+ `reason: ${reason}`;
}
function throwFirstPageFailure(kind, symbol) {
if (kind === 'auth' || kind === 'anti-bot') {
throw new AuthRequiredError('xueqiu.com', 'Stock discussions require login or challenge clearance');
}
if (kind === 'argument') {
throw new ArgumentError(`xueqiu comments received an invalid symbol: ${symbol}`);
}
if (kind === 'empty') {
throw new EmptyResultError(`xueqiu/comments ${symbol}`, `No discussion data found for ${symbol}`);
}
throw new CommandExecutionError(`Unexpected response while loading xueqiu comments for ${symbol}`, 'Run the command again with --verbose to inspect the raw site response.');
}
/**
* Extract the raw item list from one classified JSON payload.
*
* @param json Raw parsed JSON payload from browser fetch.
* @returns Discussion items when the response shape is usable.
*/
export function getCommentItems(json) {
if (!isRecord(json))
return [];
const list = getCommentList(json) ?? [];
return list.filter((item) => !!item && typeof item === 'object');
}
/**
* Classify one raw browser response before command-level error handling.
*
* @param response Structured browser response payload.
* @returns Tagged result describing the response class.View on GitHub (pinned to 49907e53dc)
Solutions
- Re-run with --verbose to inspect the raw site response and identify the new shape
- Re-login and retry — an unusual session state can produce unusual envelopes
- Retry later in case of a transient site-side change or A/B test
- If persistent, check for a library update; the response classifier likely needs the new schema
Example fix
// before opencli xueqiu comments AAPL // after (diagnose) opencli xueqiu comments AAPL --verbose # inspect raw JSON body
Defensive patterns
Strategy: retry
Try / catch
try {
const rows = await collectCommentRows(opts);
} catch (e) {
if (/Unexpected response while loading xueqiu comments/.test(e.message)) {
console.error('Unknown JSON shape — re-run with --verbose to inspect raw response');
} else throw e;
} Prevention
- Diagnose with --verbose on first occurrence to capture the raw payload
- Keep the library updated — classifier schemas must track xueqiu changes
- Rule out middleboxes (corporate proxies) returning JSON error pages
- Retry after re-login to rule out session-dependent response variants
When it happens
Trigger: First request to the search/status endpoint returns application/json that parses, but contains neither json.list nor json.data.list, and matches none of the auth/anti-bot/argument/empty text patterns.
Common situations: Xueqiu changing the /query/v1/symbol/search/status response schema; a new error envelope format the classifier does not know; CDN or proxy returning a JSON error page from a middlebox.
Related errors
- coingecko returned an unexpected response
- Unexpected response while loading xueqiu comments for ${opti
- Barchart greeks returned an unreadable options payload${data
- Cannot resolve aid for bvid: ${bvid}
- Bilibili reply add API did not return rpid for the posted co
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/0406a9b6447b9c92.
Report an issue: GitHub.