jackwener/OpenCLI · error · EmptyResultError

No visible Claude messages were found for conversation ${id}

Error message

No visible Claude messages were found for conversation ${id}.

What it means

This EmptyResultError is thrown by the `claude detail` command when, after navigating to conversation `id` and confirming a logged-in session, the page contains zero visible Claude messages. The library treats an empty extraction as a failed detail lookup rather than returning an empty result, because a real conversation always has messages.

Source

Thrown at clis/claude/detail.js:36

    columns: ['Index', 'Role', 'Text'],

    func: async (page, kwargs) => {
        const id = requireConversationId(kwargs.id);

        await page.goto(`https://claude.ai/chat/${id}`);
        // Wait for the first assistant message bubble to render instead of a
        // fixed 4 s sleep. Swallow the timeout so empty conversations and
        // login redirects fall through to ensureClaudeLogin / EmptyResultError.
        try {
            await page.wait({ selector: MESSAGE_SELECTOR, timeout: 10 });
        } catch {
            // Empty conversation, missing access, or login redirect — handled below.
        }
        await ensureClaudeLogin(page, 'Claude detail requires a logged-in Claude session.');

        const messages = await getVisibleMessages(page);
        if (messages.length > 0) return messages;
        throw new EmptyResultError('claude detail', `No visible Claude messages were found for conversation ${id}.`);
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify the conversation id exists by running `opencli claude history` and copying a fresh id
  2. Open the conversation manually in the browser to confirm it exists and is accessible to the logged-in account
  3. Re-run the command once — slow rendering can momentarily yield zero messages; a retry after full load often works
  4. Re-run `opencli claude auth` to ensure you're logged into the account that owns the conversation
  5. Update the library if Claude changed its DOM — selectors may need a newer version

Example fix

// before
opencli claude detail conv_abc123   // deleted id -> EmptyResultError
// after
opencli claude history --limit 5    # get a valid current id
opencli claude detail <valid-id>
Defensive patterns

Strategy: validation

Validate before calling

// confirm the conversation exists and is accessible before requesting detail
const history = await opencli.claude.history({ limit: 50 });
if (!history.some(c => c.id === targetId)) {
  throw new Error(`Conversation ${targetId} not found in recent history`);
}

Type guard

function hasVisibleMessages(messages) {
  return Array.isArray(messages) && messages.length > 0;
}

Try / catch

try {
  const messages = await opencli.claude.detail(targetId);
} catch (e) {
  if (e.message.startsWith('No visible Claude messages were found for conversation')) {
    const fresh = await opencli.claude.history({ limit: 20 });
    return opencli.claude.detail(fresh[0].id); // fall back to a known-good id
  }
  throw e;
}

Prevention

When it happens

Trigger: getVisibleMessages(page) returns [] after ensureClaudeLogin — the conversation id is wrong/deleted, the page shows an access-denied or not-found state, a login redirect replaced content, or Claude's DOM changed so the message selectors no longer match.

Common situations: Typo'd or stale conversation id from history; conversation deleted or in another account/org; private/shared-link conversation not accessible to the logged-in user; Claude frontend update changing message DOM structure; slow rendering so messages haven't appeared when scraped.

Related errors


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