jackwener/OpenCLI · error · EmptyResultError

chatgpt deep-research-result

Error message

chatgpt deep-research-result

What it means

The `chatgpt deep-research-result` command throws EmptyResultError('chatgpt deep-research-result') when no completed Deep Research report could be extracted from the conversation payload. After waiting (or probing with bridge probes), the result neither has status 'completed' nor any non-empty progress object, so the library considers the report absent rather than returning empty output. It exists to fail loudly instead of returning an empty/meaningless row.

Source

Thrown at clis/chatgpt/deep-research-result.js:89

        );
        const targetUrl = `${CHATGPT_URL}/c/${id}`;
        await page.readNetworkCapture?.().catch(() => []);
        const currentUrl = await currentChatGPTUrl(page).catch(() => '');
        if (currentUrl.startsWith(targetUrl)) {
            await page.goto(`${CHATGPT_URL}/?opencli_dr_result=${Date.now()}`, { waitUntil: 'none' });
            await page.wait(1);
        }
        await page.startNetworkCapture?.('/backend-api/conversation/').catch(() => false);
        await page.goto(targetUrl, { waitUntil: 'none' });
        await page.sleep(3);
        await ensureChatGPTLogin(page, 'ChatGPT deep-research-result requires a logged-in ChatGPT session.');

        const result = shouldWait
            ? await waitForChatGPTDeepResearchResult(page, { conversationId: id, timeoutSeconds: timeout, stableSeconds })
            : await getChatGPTDeepResearchResult(page, { conversationId: id, useBridgeProbes: true });

        if (result.status !== 'completed' && !hasDeepResearchProgress(result)) {
            throw new EmptyResultError(
                'chatgpt deep-research-result',
                `No completed Deep Research report was found for conversation ${id}.`,
            );
        }

        if (result.status === 'completed' && !result.report) {
            throw new EmptyResultError(
                'chatgpt deep-research-result',
                `No completed Deep Research report was found for conversation ${id}.`,
            );
        }

        return [{
            conversationId: id,
            status: result.status,
            report: result.report || '',
            sources: result.sources || [],
            progress: result.progress || {},

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify the conversation ID actually belongs to a Deep Research run (open the /c/<id> URL in a browser).
  2. Re-run with --wait and a larger --timeout (e.g. --wait --timeout 600) so the run can finish before extraction.
  3. Wait for the Deep Research run to reach at least one visible progress step, then retry.
  4. Re-login / refresh the ChatGPT session cookie so the conversation payload loads.
  5. If extraction fails consistently, check for ChatGPT DOM changes and update the library.

Example fix

// before
opencli chatgpt deep-research-result 68a2... --timeout 120
// after
opencli chatgpt deep-research-result 68a2... --wait --timeout 600 --stable 10
Defensive patterns

Strategy: validation

Validate before calling

// Check the conversation is a Deep Research run before invoking
const res = await run('chatgpt detail', id);
const isDeepResearch = /deep research|researching/i.test(res.map(r => r.text || '').join(' '));
if (!isDeepResearch) throw new Error(`${id} is not a Deep Research conversation`);

Type guard

function hasDeepResearchPayload(result) {
  return !!result && (result.status === 'completed' ? !!result.report
    : !!result.progress && typeof result.progress === 'object'
      && Object.keys(result.progress).length > 0);
}

Try / catch

try {
  const rows = await run('chatgpt deep-research-result', id, '--wait', '--timeout', '600');
} catch (err) {
  if (String(err.message).includes('deep-research-result')) {
    // fall back: check the run status in the browser or schedule a retry
  } else throw err;
}

Prevention

When it happens

Trigger: Running `opencli chatgpt deep-research-result <id>` (with or without --wait) when waitForChatGPTDeepResearchResult or getChatGPTDeepResearchResult returns a result whose status !== 'completed' AND whose progress object is empty/missing — e.g. the conversation is not a Deep Research run, the run is still running with no progress steps visible, or extraction found no report node.

Common situations: Passing a regular chat conversation ID instead of a Deep Research conversation; running too early while Deep Research is still in its browsing phase before any progress steps appear; the ChatGPT DOM changed so the extractor cannot see progress; being logged out so the conversation payload is empty.

Related errors


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