jackwener/OpenCLI · error · TimeoutError

grok export-all history dialog

Error message

grok export-all history dialog

What it means

TimeoutError('grok export-all history dialog', 8) thrown by collectHistory when the in-page script reports code 'NO_DIALOG': the Grok export/history dialog never appeared within the 8-second window. It signals a UI/state problem rather than empty data.

Source

Thrown at clis/grok/export-all.js:154

        stableRounds += 1;
      } else {
        stableRounds = 0;
        lastCount = seen.size;
        lastHeight = scroller.scrollHeight;
      }
      if (targetLimit === 0 && stableRounds >= 8) break;
    }

    return { ok: true, rows: Array.from(seen.values()) };
  })()`);

  const result = requireObjectEvaluateResult(rawResult, 'grok export-all history dialog');
  if (result.ok !== true) {
    if (result?.code === 'AUTH') {
      throw new AuthRequiredError(GROK_DOMAIN, 'Sign in to grok.com in the browser, then retry.');
    }
    if (result?.code === 'NO_DIALOG') {
      throw new TimeoutError('grok export-all history dialog', 8);
    }
    throw new EmptyResultError('grok export-all', 'No Grok conversation history was visible.');
  }
  const validRows = normalizeConversationRows(result.rows, 'grok export-all history dialog');
  if (!validRows.length) {
    throw new EmptyResultError('grok export-all', 'No Grok conversations found in the signed-in account history.');
  }
  return limit ? validRows.slice(offset, offset + limit) : validRows.slice(offset);
}

async function readConversation(page, conversation, { pageTimeoutMs, pageScrolls, delayMinMs, delayMaxMs }) {
  await page.goto(conversation.url);
  const startedAt = Date.now();
  let loaded = false;

  while (Date.now() - startedAt < pageTimeoutMs) {
    let loadedPayload;
    try {

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Retry once — transient slowness often causes this
  2. Check network speed/proxy latency when loading grok.com
  3. Update the library in case Grok changed the dialog markup and selectors were patched
  4. Clear interfering overlays (cookie banners) or use a clean profile and retry

Example fix

// before
cli.exportAll({ pageTimeoutMs: 5000 }); // tight budget on slow network
// after
cli.exportAll({ pageTimeoutMs: 30000 }); // allow page to fully load before dialog open
Defensive patterns

Strategy: retry

Validate before calling

// ensure page fully loads before export
await page.goto(GROK_URL, { waitUntil: 'networkidle' });

Try / catch

for (let attempt = 1; attempt <= 3; attempt++) {
  try { return await cli.exportAll(opts); }
  catch (e) { if (e.name === 'TimeoutError' && attempt < 3) { await sleep(2000 * attempt); continue; } throw e; }
}

Prevention

When it happens

Trigger: clis/grok/export-all.js:154 throws when the evaluate result is { ok:false, code:'NO_DIALOG' } — the export dialog failed to open within the 8s timeout.

Common situations: Slow network or heavy page making the UI exceed 8s; Grok UI redesign moving/hiding the export control; overlay or cookie banner intercepting clicks; page still loading after navigation.

Related errors


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