{"record":{"id":"e53d85bd567f5dbf","repo":"jackwener/OpenCLI","slug":"workspacestorage-not-found-trae-workspace-stora","errorCode":null,"errorMessage":"workspaceStorage not found: ${TRAE_WORKSPACE_STORAGE}","messagePattern":"workspaceStorage not found: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/trae-solo/workspaces-fs.js","lineNumber":36,"sourceCode":"    resolveWorkspaceJson,\n} from './_state.js';\n\n// -------- workspaces-list --------\ncli({\n    site: 'trae-solo',\n    name: 'workspaces-list',\n    access: 'read',\n    description: 'List Trae SOLO workspaceStorage entries (~/Library/.../TRAE SOLO/User/workspaceStorage/<uuid>/), resolving each workspace.json to its single-folder path or multi-folder workspace target. Works while Trae is closed.',\n    domain: 'localhost',\n    browser: false,\n    strategy: Strategy.LOCAL,\n    args: [\n        { name: 'limit', type: 'int', required: false, default: 100 },\n    ],\n    columns: ['Index', 'Workspace Id', 'Kind', 'Target', 'Modified', 'Id', 'Version', 'Source', 'Installed'],\n    func: async (args) => {\n        if (!fs.existsSync(TRAE_WORKSPACE_STORAGE)) {\n            throw new CommandExecutionError(\n                `workspaceStorage not found: ${TRAE_WORKSPACE_STORAGE}`,\n                '',\n            );\n        }\n        const dirs = fs.readdirSync(TRAE_WORKSPACE_STORAGE).filter((n) => {\n            const full = path.join(TRAE_WORKSPACE_STORAGE, n);\n            return fs.statSync(full).isDirectory();\n        });\n        if (!dirs.length) {\n            throw new EmptyResultError('trae-solo workspaces-list', 'No workspace storage entries.');\n        }\n        const rows = dirs.map((id) => {\n            const dir = path.join(TRAE_WORKSPACE_STORAGE, id);\n            const wj = path.join(dir, 'workspace.json');\n            const resolved = resolveWorkspaceJson(wj);\n            const mtime = fs.statSync(dir).mtimeMs;\n            return { id, kind: resolved.kind, target: resolved.target, mtime };\n        }).sort((a, b) => b.mtime - a.mtime);","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/trae-solo/workspaces-fs.js#L18-L54","documentation":"This CommandExecutionError is thrown by the workspaces-list command when the Trae workspaceStorage directory (constant TRAE_WORKSPACE_STORAGE) does not exist on disk. The CLI checks fs.existsSync on that root before enumerating per-workspace directories, failing fast when Trae has never stored workspace data at that path.","triggerScenarios":"Running the command on a machine where Trae SOLO was never launched; TRAE_WORKSPACE_STORAGE pointing at a custom/wrong location; a Trae update changing the storage path layout; running under a different OS user whose home directory differs.","commonSituations":"Fresh machine or CI container without Trae history; Trae portable/Insiders build with a different data dir; sudo vs normal user mismatch redirecting the home-based path; profile path changes after an upgrade.","solutions":["Launch Trae SOLO once and open a workspace so workspaceStorage gets created, then retry","Verify TRAE_WORKSPACE_STORAGE points at the actual storage dir (compare with the path printed in the error) and correct it if wrong","Check that the user profile running the command matches the one running Trae (HOME / APPDATA differences)","Locate the real storage dir per Trae docs (e.g., Application Support / %APPDATA%) and update the constant"],"exampleFix":"// before\nconst TRAE_WORKSPACE_STORAGE = path.join(os.homedir(), '.trae', 'workspaceStorage');\n// after\nconst candidates = [path.join(os.homedir(), '.trae', 'workspaceStorage'),\n                    path.join(os.homedir(), 'Library', 'Application Support', 'Trae', 'User', 'workspaceStorage'),\n                    path.join(process.env.APPDATA || '', 'Trae', 'User', 'workspaceStorage')];\nconst TRAE_WORKSPACE_STORAGE = candidates.find((p) => fs.existsSync(p));","handlingStrategy":"fallback","validationCode":"if (!fs.existsSync(TRAE_WORKSPACE_STORAGE)) {\n    console.warn(`workspaceStorage missing at ${TRAE_WORKSPACE_STORAGE}; launch Trae first.`);\n}","typeGuard":null,"tryCatchPattern":"try {\n    const rows = await runWorkspacesList();\n} catch (e) {\n    if (/workspaceStorage not found/.test(e.message)) {\n        console.warn('Trae workspaceStorage does not exist yet; nothing to list.');\n        return [];\n    }\n    throw e;\n}","preventionTips":["Launch Trae SOLO and open a workspace once before running inspection commands","Verify the storage path constant matches the installed Trae build and profile","Run the CLI as the same OS user that runs Trae","Compare the printed error path against the real Trae data directory"],"tags":["filesystem","environment","missing-directory"],"backgroundTag":"missing-directory","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}