{"record":{"id":"94c29a736a5c1ffe","repo":"jackwener/OpenCLI","slug":"grok-detail","errorCode":null,"errorMessage":"grok detail","messagePattern":"grok detail","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"error","filePath":"clis/grok/detail.js","lineNumber":48,"sourceCode":"        await page.goto(`https://grok.com/c/${sessionId}`);\n        await page.wait(2);\n\n        // Poll for the conversation transcript to load. Grok renders the chat\n        // page shell before fetching message history, so a fixed wait can race\n        // the initial empty render. Cap at ~20s so genuinely missing IDs surface\n        // an EmptyResultError rather than hanging.\n        let bubbles = [];\n        const POLL_DEADLINE_MS = 20_000;\n        const POLL_INTERVAL_S = 1;\n        const startedAt = Date.now();\n        while (Date.now() - startedAt < POLL_DEADLINE_MS) {\n            bubbles = await getMessageBubbles(page);\n            if (bubbles.length > 0) break;\n            await page.wait(POLL_INTERVAL_S);\n        }\n\n        if (!bubbles.length) {\n            throw new EmptyResultError(\n                'grok detail',\n                `No visible messages found for conversation ${sessionId}. Verify the ID is correct and that the conversation belongs to the signed-in account.`,\n            );\n        }\n        return bubbles.map((b) => ({\n            Role: b.role,\n            Text: wantMarkdown && b.role === 'Assistant' && b.html\n                ? (bubbleHtmlToMarkdown(b.html) || b.text)\n                : b.text,\n        }));\n    },\n});\n","sourceCodeStart":30,"sourceCodeEnd":61,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/grok/detail.js#L30-L61","documentation":"EmptyResultError('grok detail') is thrown after the CLI repeatedly polls the conversation page and no message bubbles ever appear for the given sessionId. It means Grok rendered the conversation page but no visible messages could be extracted within the polling window. The library throws this to distinguish 'conversation not found / not accessible' from page or network crashes.","triggerScenarios":"clis/grok/detail.js:48 throws when getMessageBubbles(page) returns an empty array on every poll cycle for the requested conversation sessionId.","commonSituations":"Typos or stale conversation IDs; the conversation belongs to a different Grok account than the signed-in browser session; deleted conversations; page markup changes that break bubble detection.","solutions":["Verify the conversation sessionId is correct and copy it fresh from the Grok URL","Confirm you are signed in to grok.com in the browser and that the conversation appears in your account","Try opening the conversation URL manually to confirm it renders messages","Update the library in case Grok's DOM changed and bubble selectors were fixed"],"exampleFix":"// before\nawait cli.detail({ sessionId: 'abc12' }); // truncated/wrong id\n// after\nawait cli.detail({ sessionId: 'c0ffee-1234-abcd-full-id-from-url' });","handlingStrategy":"validation","validationCode":"if (!sessionId || typeof sessionId !== 'string' || sessionId.length < 8) throw new Error('Provide a full Grok conversation sessionId from the conversation URL');","typeGuard":"function isValidSessionId(v) { return typeof v === 'string' && /^[A-Za-z0-9-]{8,}$/.test(v); }","tryCatchPattern":"try { await cli.detail({ sessionId }); } catch (e) { if (e.name === 'EmptyResultError') { console.error('Conversation not found/accessible — check ID and sign-in'); } else throw e; }","preventionTips":["Copy sessionId directly from the conversation URL","Verify the conversation exists while signed in before scripting","Use a persistent authenticated browser profile","Keep the library updated for Grok DOM changes"],"tags":["empty-result","scraping","authentication"],"backgroundTag":"empty-result-error","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}