jackwener/OpenCLI · error · EmptyResultError
grok detail
Error message
grok detail
What it means
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.
Source
Thrown at clis/grok/detail.js:48
await page.goto(`https://grok.com/c/${sessionId}`);
await page.wait(2);
// Poll for the conversation transcript to load. Grok renders the chat
// page shell before fetching message history, so a fixed wait can race
// the initial empty render. Cap at ~20s so genuinely missing IDs surface
// an EmptyResultError rather than hanging.
let bubbles = [];
const POLL_DEADLINE_MS = 20_000;
const POLL_INTERVAL_S = 1;
const startedAt = Date.now();
while (Date.now() - startedAt < POLL_DEADLINE_MS) {
bubbles = await getMessageBubbles(page);
if (bubbles.length > 0) break;
await page.wait(POLL_INTERVAL_S);
}
if (!bubbles.length) {
throw new EmptyResultError(
'grok detail',
`No visible messages found for conversation ${sessionId}. Verify the ID is correct and that the conversation belongs to the signed-in account.`,
);
}
return bubbles.map((b) => ({
Role: b.role,
Text: wantMarkdown && b.role === 'Assistant' && b.html
? (bubbleHtmlToMarkdown(b.html) || b.text)
: b.text,
}));
},
});
View on GitHub (pinned to 49907e53dc)
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
Example fix
// before
await cli.detail({ sessionId: 'abc12' }); // truncated/wrong id
// after
await cli.detail({ sessionId: 'c0ffee-1234-abcd-full-id-from-url' }); Defensive patterns
Strategy: validation
Validate before calling
if (!sessionId || typeof sessionId !== 'string' || sessionId.length < 8) throw new Error('Provide a full Grok conversation sessionId from the conversation URL'); Type guard
function isValidSessionId(v) { return typeof v === 'string' && /^[A-Za-z0-9-]{8,}$/.test(v); } Try / catch
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; } Prevention
- 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
When it happens
Trigger: clis/grok/detail.js:48 throws when getMessageBubbles(page) returns an empty array on every poll cycle for the requested conversation sessionId.
Common situations: 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.
Related errors
- No posts were returned for user ${args.username}. Confirm th
- @${username} has no recent tweets
- No note detail data found. Check note_id and login status fo
- zhihu collections
- 1point3acres thread
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/94c29a736a5c1ffe.
Report an issue: GitHub.