jackwener/OpenCLI · info · EmptyResultError

history.recentlyOpenedPathsList has no entries.

Error message

history.recentlyOpenedPathsList has no entries.

What it means

An EmptyResultError from recent-workspaces when 'history.recentlyOpenedPathsList' exists but its entries array is empty. The key is present in the ItemTable, yet Trae recorded zero recent workspaces/folders/files.

Source

Thrown at clis/trae-solo/state-fs.js:138

    description: 'Show Trae SOLO\'s recently-opened workspaces (the File → Open Recent menu, stored under key "history.recentlyOpenedPathsList" in state.vscdb).',
    domain: 'localhost',
    browser: false,
    strategy: Strategy.LOCAL,
    args: [
        { name: 'limit', type: 'int', required: false, default: 20 },
    ],
    columns: ['Index', 'Key', 'Kind', 'Path'],
    func: async (args) => {
        if (!fs.existsSync(TRAE_GLOBAL_STATE_DB)) {
            throw new CommandExecutionError(`state.vscdb not found: ${TRAE_GLOBAL_STATE_DB}`, '');
        }
        const val = getValue(TRAE_GLOBAL_STATE_DB, 'history.recentlyOpenedPathsList');
        if (!val) {
            throw new EmptyResultError('trae-solo recent-workspaces', 'No recent workspaces recorded.');
        }
        const entries = val.entries || [];
        if (!entries.length) {
            throw new EmptyResultError('trae-solo recent-workspaces', 'history.recentlyOpenedPathsList has no entries.');
        }
        const limit = Number.isInteger(args.limit) && args.limit > 0 ? args.limit : 20;
        return entries.slice(0, limit).map((e, i) => {
            let kind = 'other', target = JSON.stringify(e).slice(0, 200);
            if (e.folderUri) {
                kind = 'folder';
                target = decodeURI(String(e.folderUri).replace(/^file:\/\//, ''));
            } else if (e.workspace && e.workspace.configPath) {
                kind = 'workspace';
                target = decodeURI(String(e.workspace.configPath).replace(/^file:\/\//, ''));
            } else if (e.fileUri) {
                kind = 'file';
                target = decodeURI(String(e.fileUri).replace(/^file:\/\//, ''));
            }
            return { Index: i + 1, Key: '', Kind: kind, Path: target };
        });
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Open a workspace in Trae, close it, and retry recent-workspaces.
  2. Fall back to `opencli trae-solo workspaces-list` to enumerate workspaceStorage folders directly.
  3. Check the raw value with `state-get --key history.recentlyOpenedPathsList` to confirm entries is [].

Example fix

// before
opencli trae-solo recent-workspaces   # entries: []
// after
opencli trae-solo workspaces-list   # scan workspaceStorage instead
Defensive patterns

Strategy: fallback

Validate before calling

const val = getValue(TRAE_GLOBAL_STATE_DB, 'history.recentlyOpenedPathsList');
if (val && (!val.entries || !val.entries.length)) console.warn('history key exists but entries is empty');

Try / catch

try {
  return await recentWorkspaces(args);
} catch (e) {
  if (/has no entries/.test(e.message)) return workspacesList(args);
  throw e;
}

Prevention

When it happens

Trigger: The stored value parses to an object without entries, or entries was explicitly emptied (user cleared recent list in Trae, or history was pruned).

Common situations: User clicked 'Clear Recently Opened' in Trae; Trae closed without persisting history; profile duplicated/reset wiping entries while keeping the key shell.

Related errors


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