jackwener/OpenCLI · warning · TimeoutError

点点没有在超时时间内返回答案;可以重试或提高 --timeout。

Error message

点点没有在超时时间内返回答案;可以重试或提高 --timeout。

What it means

After sending a query to Xiaohongshu's 点点 assistant, the in-page script reports a raw error; mapAskError translates 'answer_timeout' into a TimeoutError noting that 点点 did not return an answer within the configured --timeout seconds. The message suggests retrying or raising --timeout. It is a mapped, expected failure mode rather than a bug.

Source

Thrown at clis/xiaohongshu/ask.js:366

            error: String(err?.message || err || 'unknown_error'),
            stack: String(err?.stack || '').slice(0, 1500),
            page_url: location.href,
          };
        }
      })()
    `;
}

function requirePrompt(query) {
    const prompt = String(query || '').trim();
    if (!prompt) throw new ArgumentError('query is required');
    return prompt;
}

function mapAskError(raw, timeoutSeconds) {
    const error = compactSingleLine(raw?.error);
    if (error === 'answer_timeout') {
        throw new TimeoutError('xiaohongshu ask', timeoutSeconds, '点点没有在超时时间内返回答案;可以重试或提高 --timeout。');
    }
    if (error === 'send_message_failed') {
        throw new AuthRequiredError(XHS_WEB_HOST, 'Xiaohongshu 点点 did not accept the query. Check login status for www.xiaohongshu.com.');
    }
    throw new CommandExecutionError(
        `xiaohongshu ask failed: ${error || 'unknown error'}`,
        raw?.page_url ? `Page URL: ${raw.page_url}` : undefined,
    );
}

function requireAskPayload(raw) {
    if (!raw || typeof raw !== 'object') {
        throw new CommandExecutionError('xiaohongshu ask returned a malformed page payload');
    }
    const answer = cleanText(raw.answer || raw.base_info?.text || '');
    if (!answer) {
        throw new CommandExecutionError('xiaohongshu ask returned a malformed page payload: missing answer');
    }

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Retry the same query — the timeout is often transient
  2. Increase --timeout up to 180: opencli xiaohongshu ask --timeout 180 "..."
  3. Simplify or split the query into smaller questions 点点 can answer faster
  4. Verify the xiaohongshu login session is healthy and the site is reachable, then retry

Example fix

// before
opencli xiaohongshu ask --timeout 90 "very complex multi-part question"
// after
opencli xiaohongshu ask --timeout 180 "very complex multi-part question"
Defensive patterns

Strategy: retry

Validate before calling

null

Type guard

null

Try / catch

const { TimeoutError } = errors;
try {
  return await xiaohongshuAsk({ query, timeout: 180 });
} catch (e) {
  if (e instanceof TimeoutError && /answer/.test(e.command || '')) {
    await sleep(5000);
    return xiaohongshuAsk({ query, timeout: 180 }); // one retry
  }
  throw e;
}

Prevention

When it happens

Trigger: The raw in-page result contains error === 'answer_timeout' — the assistant conversation never produced a final answer within timeoutSeconds (1–180, default 90).

Common situations: Very complex/slow queries where 点点 needs longer than the default 90s; degraded backend latency on xiaohongshu's side; heavy network latency; asking during peak hours.

Understand the failure class

Related errors


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