{"record":{"id":"527c66198605cef9","repo":"jackwener/OpenCLI","slug":"chatgpt-deep-research-result-527c66","errorCode":null,"errorMessage":"chatgpt deep-research-result","messagePattern":"chatgpt deep-research-result","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"error","filePath":"clis/chatgpt/utils.js","lineNumber":2123,"sourceCode":"                return { ...result, stableSeconds: 0 };\n            }\n            if (result.report === lastReport) {\n                if (!stableStartedAt) stableStartedAt = Date.now();\n                const elapsedSeconds = Math.floor((Date.now() - stableStartedAt) / 1000);\n                if (elapsedSeconds >= stableSeconds) {\n                    return { ...result, stableSeconds: elapsedSeconds };\n                }\n            } else {\n                lastReport = result.report;\n                stableStartedAt = Date.now();\n            }\n        } else if (result.status !== 'running' && result.status !== 'not_ready') {\n            return result;\n        }\n        await page.sleep(3);\n    }\n\n    throw new TimeoutError(\n        'chatgpt deep-research-result',\n        timeoutSeconds,\n        'Deep Research did not complete or become extractable before timeout.',\n    );\n}\n\nexport function messageHtmlToMarkdown(html) {\n    try {\n        return htmlToMarkdown(html).trim();\n    } catch {\n        return String(html || '').replace(/<[^>]+>/g, ' ').replace(/\\s+/g, ' ').trim();\n    }\n}\n\nexport async function getBubbleCount(page) {\n    const messages = await getVisibleMessages(page);\n    return messages.length;\n}","sourceCodeStart":2105,"sourceCodeEnd":2141,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/chatgpt/utils.js#L2105-L2141","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-run with a larger --timeout (deep research can take many minutes)","Check the conversation manually in the browser — if the result finished later, extract it directly from the conversation payload","Verify network connectivity / ChatGPT service status if the run appears stuck indefinitely","Retry the deep research request if the run is hung"],"exampleFix":"// before\nawait chatgptDeepResearch(prompt);            // default timeout\n// after\nawait chatgptDeepResearch(prompt, { timeout: 1800 }); // 30 min","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await waitForChatGPTDeepResearchResult(page, { conversationId, timeoutSeconds: 300 });\n} catch (e) {\n  if (e instanceof TimeoutError && e.operation === 'chatgpt deep-research-result') {\n    // retry with a much larger timeout, or extract the result from the conversation payload directly\n  } else throw e;\n}","preventionTips":["Budget 10-30+ minutes for deep research tasks in --timeout","Check the conversation manually before retrying — the result may have completed after the deadline","Prefer extracting from the conversation payload/network capture if the run completes late"],"tags":["timeout","chatgpt","deep-research"],"backgroundTag":"operation-timed-out","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}