{"record":{"id":"e2a0baa9f4af0634","repo":"jackwener/OpenCLI","slug":"chatgpt-deep-research-result","errorCode":null,"errorMessage":"chatgpt deep-research-result","messagePattern":"chatgpt deep-research-result","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"error","filePath":"clis/chatgpt/deep-research-result.js","lineNumber":89,"sourceCode":"        );\n        const targetUrl = `${CHATGPT_URL}/c/${id}`;\n        await page.readNetworkCapture?.().catch(() => []);\n        const currentUrl = await currentChatGPTUrl(page).catch(() => '');\n        if (currentUrl.startsWith(targetUrl)) {\n            await page.goto(`${CHATGPT_URL}/?opencli_dr_result=${Date.now()}`, { waitUntil: 'none' });\n            await page.wait(1);\n        }\n        await page.startNetworkCapture?.('/backend-api/conversation/').catch(() => false);\n        await page.goto(targetUrl, { waitUntil: 'none' });\n        await page.sleep(3);\n        await ensureChatGPTLogin(page, 'ChatGPT deep-research-result requires a logged-in ChatGPT session.');\n\n        const result = shouldWait\n            ? await waitForChatGPTDeepResearchResult(page, { conversationId: id, timeoutSeconds: timeout, stableSeconds })\n            : await getChatGPTDeepResearchResult(page, { conversationId: id, useBridgeProbes: true });\n\n        if (result.status !== 'completed' && !hasDeepResearchProgress(result)) {\n            throw new EmptyResultError(\n                'chatgpt deep-research-result',\n                `No completed Deep Research report was found for conversation ${id}.`,\n            );\n        }\n\n        if (result.status === 'completed' && !result.report) {\n            throw new EmptyResultError(\n                'chatgpt deep-research-result',\n                `No completed Deep Research report was found for conversation ${id}.`,\n            );\n        }\n\n        return [{\n            conversationId: id,\n            status: result.status,\n            report: result.report || '',\n            sources: result.sources || [],\n            progress: result.progress || {},","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/chatgpt/deep-research-result.js#L71-L107","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the conversation ID actually belongs to a Deep Research run (open the /c/<id> URL in a browser).","Re-run with --wait and a larger --timeout (e.g. --wait --timeout 600) so the run can finish before extraction.","Wait for the Deep Research run to reach at least one visible progress step, then retry.","Re-login / refresh the ChatGPT session cookie so the conversation payload loads.","If extraction fails consistently, check for ChatGPT DOM changes and update the library."],"exampleFix":"// before\nopencli chatgpt deep-research-result 68a2... --timeout 120\n// after\nopencli chatgpt deep-research-result 68a2... --wait --timeout 600 --stable 10","handlingStrategy":"validation","validationCode":"// Check the conversation is a Deep Research run before invoking\nconst res = await run('chatgpt detail', id);\nconst isDeepResearch = /deep research|researching/i.test(res.map(r => r.text || '').join(' '));\nif (!isDeepResearch) throw new Error(`${id} is not a Deep Research conversation`);","typeGuard":"function hasDeepResearchPayload(result) {\n  return !!result && (result.status === 'completed' ? !!result.report\n    : !!result.progress && typeof result.progress === 'object'\n      && Object.keys(result.progress).length > 0);\n}","tryCatchPattern":"try {\n  const rows = await run('chatgpt deep-research-result', id, '--wait', '--timeout', '600');\n} catch (err) {\n  if (String(err.message).includes('deep-research-result')) {\n    // fall back: check the run status in the browser or schedule a retry\n  } else throw err;\n}","preventionTips":["Only call this on conversations that are actually Deep Research runs","Always pass --wait with a generous --timeout (>= 600s) for long research jobs","Keep the ChatGPT session freshly authenticated before long waits","Retry once after a delay before treating the run as failed"],"tags":["chatgpt","empty-result","deep-research"],"backgroundTag":"empty-result-no-data","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}