jackwener/OpenCLI · error · TimeoutError

chatgpt deep-research-result

Error message

chatgpt deep-research-result

What it means

TimeoutError raised while polling for a Deep Research result. The library polls page state until status becomes a terminal value ('completed', etc.); if it stays 'running'/'not_ready' past timeoutSeconds it gives up with this error.

Source

Thrown at clis/chatgpt/utils.js:2123

                return { ...result, stableSeconds: 0 };
            }
            if (result.report === lastReport) {
                if (!stableStartedAt) stableStartedAt = Date.now();
                const elapsedSeconds = Math.floor((Date.now() - stableStartedAt) / 1000);
                if (elapsedSeconds >= stableSeconds) {
                    return { ...result, stableSeconds: elapsedSeconds };
                }
            } else {
                lastReport = result.report;
                stableStartedAt = Date.now();
            }
        } else if (result.status !== 'running' && result.status !== 'not_ready') {
            return result;
        }
        await page.sleep(3);
    }

    throw new TimeoutError(
        'chatgpt deep-research-result',
        timeoutSeconds,
        'Deep Research did not complete or become extractable before timeout.',
    );
}

export function messageHtmlToMarkdown(html) {
    try {
        return htmlToMarkdown(html).trim();
    } catch {
        return String(html || '').replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim();
    }
}

export async function getBubbleCount(page) {
    const messages = await getVisibleMessages(page);
    return messages.length;
}

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Re-run with a larger --timeout (deep research can take many minutes)
  2. Check the conversation manually in the browser — if the result finished later, extract it directly from the conversation payload
  3. Verify network connectivity / ChatGPT service status if the run appears stuck indefinitely
  4. Retry the deep research request if the run is hung

Example fix

// before
await chatgptDeepResearch(prompt);            // default timeout
// after
await chatgptDeepResearch(prompt, { timeout: 1800 }); // 30 min
Defensive patterns

Strategy: retry

Try / catch

try {
  await waitForChatGPTDeepResearchResult(page, { conversationId, timeoutSeconds: 300 });
} catch (e) {
  if (e instanceof TimeoutError && e.operation === 'chatgpt deep-research-result') {
    // retry with a much larger timeout, or extract the result from the conversation payload directly
  } else throw e;
}

Prevention

When it happens

Trigger: waitForChatGPTDeepResearchResult looped for timeoutSeconds, re-checking every ~3s, and the result never transitioned out of running/not_ready — the research is still executing or the completion signal was never observed.

Common situations: Deep Research genuinely takes longer than the default timeout (complex queries can run 10+ minutes); stuck 'running' badge due to a hung backend task; user kept --timeout too low.

Related errors


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