jackwener/OpenCLI · warning · EmptyResultError

No recent workspaces recorded.

Error message

No recent workspaces recorded.

What it means

An EmptyResultError from recent-workspaces when the DB exists but getValue('history.recentlyOpenedPathsList') returns nothing (no row or empty/null value). Trae stores the recent-workspace list under that key; its absence means no history has been recorded yet.

Source

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

cli({
    site: 'trae-solo',
    name: 'recent-workspaces',
    access: 'read',
    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:\/\//, ''));
            }

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Open at least one folder or workspace in Trae, quit it cleanly, then retry.
  2. Inspect the DB directly (state-keys --filter history) to see if the key exists under a different name.
  3. Use `workspaces-list` (workspaceStorage scan) as an alternative source of workspace ids.
  4. If Trae recently updated, confirm the key name 'history.recentlyOpenedPathsList' is still used.

Example fix

// before
opencli trae-solo recent-workspaces   # empty: Trae never opened a folder
// after
# open a folder in Trae once, close it, then:
opencli trae-solo recent-workspaces
Defensive patterns

Strategy: fallback

Validate before calling

const val = getValue(TRAE_GLOBAL_STATE_DB, 'history.recentlyOpenedPathsList');
if (!val) console.warn('history key absent; falling back to workspaceStorage scan');

Try / catch

try {
  return await recentWorkspaces(args);
} catch (e) {
  if (/No recent workspaces recorded/.test(e.message)) return workspacesList(args);
  throw e;
}

Prevention

When it happens

Trigger: Running recent-workspaces against a Trae profile where the window state was never persisted (no folders/workspaces opened), or the key was cleared/reset.

Common situations: Freshly installed Trae opened only to a welcome screen; profile recreated after clearing app data; Trae version migrating the key elsewhere.

Related errors


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