{"record":{"id":"f939c56ce93b476a","repo":"jackwener/OpenCLI","slug":"no-recent-workspaces-recorded","errorCode":null,"errorMessage":"No recent workspaces recorded.","messagePattern":"No recent workspaces recorded\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/trae-solo/state-fs.js","lineNumber":134,"sourceCode":"cli({\n    site: 'trae-solo',\n    name: 'recent-workspaces',\n    access: 'read',\n    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            }","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/trae-solo/state-fs.js#L116-L152","documentation":"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.","triggerScenarios":"Running recent-workspaces against a Trae profile where the window state was never persisted (no folders/workspaces opened), or the key was cleared/reset.","commonSituations":"Freshly installed Trae opened only to a welcome screen; profile recreated after clearing app data; Trae version migrating the key elsewhere.","solutions":["Open at least one folder or workspace in Trae, quit it cleanly, then retry.","Inspect the DB directly (state-keys --filter history) to see if the key exists under a different name.","Use `workspaces-list` (workspaceStorage scan) as an alternative source of workspace ids.","If Trae recently updated, confirm the key name 'history.recentlyOpenedPathsList' is still used."],"exampleFix":"// before\nopencli trae-solo recent-workspaces   # empty: Trae never opened a folder\n// after\n# open a folder in Trae once, close it, then:\nopencli trae-solo recent-workspaces","handlingStrategy":"fallback","validationCode":"const val = getValue(TRAE_GLOBAL_STATE_DB, 'history.recentlyOpenedPathsList');\nif (!val) console.warn('history key absent; falling back to workspaceStorage scan');","typeGuard":null,"tryCatchPattern":"try {\n  return await recentWorkspaces(args);\n} catch (e) {\n  if (/No recent workspaces recorded/.test(e.message)) return workspacesList(args);\n  throw e;\n}","preventionTips":["Open and cleanly close a folder in Trae before expecting history","Fall back to workspaces-list when history is empty","Avoid clearing Trae's recent list before running scripts that need it","Verify the key name after Trae updates"],"tags":["empty-result","state-db","cli"],"backgroundTag":"no-matching-results","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}