jackwener/OpenCLI · warning · EmptyResultError

No conversation history found in Cursor.

Error message

No conversation history found in Cursor.

What it means

Thrown by the Cursor read command when the browser-side script extracts conversation history but returns an empty or null list. The library throws it to signal that Cursor is installed/reachable but contains no readable conversation data, distinguishing 'empty data' from a hard failure.

Solutions

  1. Open Cursor and confirm at least one conversation exists in the history panel
  2. Verify the CLI is pointing at the correct Cursor profile/user-data directory
  3. Update the CLI in case Cursor changed its storage format
  4. If history genuinely should exist, inspect Cursor's state storage manually for corruption

Example fix

// before
opencli cursor read
// Error: No conversation history found in Cursor.
// after
opencli cursor read || echo 'No Cursor history yet — start a chat in Cursor first'
Defensive patterns

Strategy: fallback

Validate before calling

// Nothing to validate before the call; detect emptiness after instead.
const history = await cursorRead();

Type guard

function hasHistory(h) {
  return Array.isArray(h) && h.length > 0 && h.every(e => e && typeof e.text === 'string');
}

Try / catch

let history;
try {
  history = await cursorRead();
} catch (err) {
  if (/No conversation history found/i.test(err.message)) {
    history = []; // treat as empty, not fatal
  } else throw err;
}

Prevention

When it happens

Trigger: Running the cursor read CLI command when Cursor has no chat/conversation history stored on disk, the history storage is empty, or the extraction script in the Cursor editor context returns an empty array.

Common situations: Fresh Cursor installation with no chats yet; user cleared all conversations; wrong Cursor profile/workspace selected; Cursor changed its internal history storage layout so the extraction finds nothing.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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

Appendix: source

Thrown at clis/cursor/read.js:41

            let text = '';
            
            // Try to get structured markdown root for AI, or lexical text for human
            const markdownRoot = msg.querySelector('.markdown-root');
            if (markdownRoot) {
                text = markdownRoot.innerText || markdownRoot.textContent;
            } else {
                text = msg.innerText || msg.textContent;
            }

            return {
                Role: role === 'human' ? 'User' : 'Assistant',
                Text: text.trim()
            };
        });
      })()
    `);
        if (!history || history.length === 0) {
            throw new EmptyResultError('cursor read', 'No conversation history found in Cursor.');
        }
        return history;
    },
});

View on GitHub (pinned to 49907e53dc)