{"record":{"id":"6e2f565a89161735","repo":"jackwener/OpenCLI","slug":"history-recentlyopenedpathslist-has-no-entries","errorCode":null,"errorMessage":"history.recentlyOpenedPathsList has no entries.","messagePattern":"history\\.recentlyOpenedPathsList has no entries\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"info","filePath":"clis/trae-solo/state-fs.js","lineNumber":138,"sourceCode":"    description: 'Show Trae SOLO\\'s recently-opened workspaces (the File → Open Recent menu, stored under key \"history.recentlyOpenedPathsList\" in state.vscdb).',\n    domain: 'localhost',\n    browser: false,\n    strategy: Strategy.LOCAL,\n    args: [\n        { name: 'limit', type: 'int', required: false, default: 20 },\n    ],\n    columns: ['Index', 'Key', 'Kind', 'Path'],\n    func: async (args) => {\n        if (!fs.existsSync(TRAE_GLOBAL_STATE_DB)) {\n            throw new CommandExecutionError(`state.vscdb not found: ${TRAE_GLOBAL_STATE_DB}`, '');\n        }\n        const val = getValue(TRAE_GLOBAL_STATE_DB, 'history.recentlyOpenedPathsList');\n        if (!val) {\n            throw new EmptyResultError('trae-solo recent-workspaces', 'No recent workspaces recorded.');\n        }\n        const entries = val.entries || [];\n        if (!entries.length) {\n            throw new EmptyResultError('trae-solo recent-workspaces', 'history.recentlyOpenedPathsList has no entries.');\n        }\n        const limit = Number.isInteger(args.limit) && args.limit > 0 ? args.limit : 20;\n        return entries.slice(0, limit).map((e, i) => {\n            let kind = 'other', target = JSON.stringify(e).slice(0, 200);\n            if (e.folderUri) {\n                kind = 'folder';\n                target = decodeURI(String(e.folderUri).replace(/^file:\\/\\//, ''));\n            } else if (e.workspace && e.workspace.configPath) {\n                kind = 'workspace';\n                target = decodeURI(String(e.workspace.configPath).replace(/^file:\\/\\//, ''));\n            } else if (e.fileUri) {\n                kind = 'file';\n                target = decodeURI(String(e.fileUri).replace(/^file:\\/\\//, ''));\n            }\n            return { Index: i + 1, Key: '', Kind: kind, Path: target };\n        });\n    },\n});","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/trae-solo/state-fs.js#L120-L156","documentation":"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.","triggerScenarios":"The stored value parses to an object without entries, or entries was explicitly emptied (user cleared recent list in Trae, or history was pruned).","commonSituations":"User clicked 'Clear Recently Opened' in Trae; Trae closed without persisting history; profile duplicated/reset wiping entries while keeping the key shell.","solutions":["Open a workspace in Trae, close it, and retry recent-workspaces.","Fall back to `opencli trae-solo workspaces-list` to enumerate workspaceStorage folders directly.","Check the raw value with `state-get --key history.recentlyOpenedPathsList` to confirm entries is []."],"exampleFix":"// before\nopencli trae-solo recent-workspaces   # entries: []\n// after\nopencli trae-solo workspaces-list   # scan workspaceStorage instead","handlingStrategy":"fallback","validationCode":"const val = getValue(TRAE_GLOBAL_STATE_DB, 'history.recentlyOpenedPathsList');\nif (val && (!val.entries || !val.entries.length)) console.warn('history key exists but entries is empty');","typeGuard":null,"tryCatchPattern":"try {\n  return await recentWorkspaces(args);\n} catch (e) {\n  if (/has no entries/.test(e.message)) return workspacesList(args);\n  throw e;\n}","preventionTips":["Use workspaces-list as the canonical source when history is known to be cleared","Have Trae open a workspace at least once to populate entries","Inspect the raw value with state-get before interpreting emptiness as a bug"],"tags":["empty-result","state-db"],"backgroundTag":"no-matching-results","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}