jackwener/OpenCLI · info · EmptyResultError

No workspace storage entries.

Error message

No workspace storage entries.

What it means

This EmptyResultError is thrown by the workspaces-list command when workspaceStorage exists but contains no subdirectories to list. The directory filter keeps only directories; if none remain the command reports an empty result instead of a hard error.

Source

Thrown at clis/trae-solo/workspaces-fs.js:46

    browser: false,
    strategy: Strategy.LOCAL,
    args: [
        { name: 'limit', type: 'int', required: false, default: 100 },
    ],
    columns: ['Index', 'Workspace Id', 'Kind', 'Target', 'Modified', 'Id', 'Version', 'Source', 'Installed'],
    func: async (args) => {
        if (!fs.existsSync(TRAE_WORKSPACE_STORAGE)) {
            throw new CommandExecutionError(
                `workspaceStorage not found: ${TRAE_WORKSPACE_STORAGE}`,
                '',
            );
        }
        const dirs = fs.readdirSync(TRAE_WORKSPACE_STORAGE).filter((n) => {
            const full = path.join(TRAE_WORKSPACE_STORAGE, n);
            return fs.statSync(full).isDirectory();
        });
        if (!dirs.length) {
            throw new EmptyResultError('trae-solo workspaces-list', 'No workspace storage entries.');
        }
        const rows = dirs.map((id) => {
            const dir = path.join(TRAE_WORKSPACE_STORAGE, id);
            const wj = path.join(dir, 'workspace.json');
            const resolved = resolveWorkspaceJson(wj);
            const mtime = fs.statSync(dir).mtimeMs;
            return { id, kind: resolved.kind, target: resolved.target, mtime };
        }).sort((a, b) => b.mtime - a.mtime);
        const limit = Number.isInteger(args.limit) && args.limit > 0 ? args.limit : 100;
        return rows.slice(0, limit).map((r, i) => ({
            Index: i + 1,
            'Workspace Id': r.id,
            Kind: r.kind,
            Target: (r.target || '').slice(0, 120),
            Modified: new Date(r.mtime).toISOString().replace('T', ' ').slice(0, 19),
            Id: '',
            Version: '',
            Source: '',

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Open a workspace in Trae SOLO so its storage entry is created, then retry
  2. Confirm with `ls -la <workspaceStorage>` that there really are no workspace directories
  3. Restore deleted workspace entries from backup or accept the empty state
  4. Point TRAE_WORKSPACE_STORAGE at the storage root of the Trae profile actually in use

Example fix

// before
if (!dirs.length) {
    throw new EmptyResultError('trae-solo workspaces-list', 'No workspace storage entries.');
}
// after
if (!dirs.length) {
    return [];  // empty storage is normal on fresh installs
}
Defensive patterns

Strategy: try-catch

Validate before calling

const dirs = fs.existsSync(TRAE_WORKSPACE_STORAGE)
    ? fs.readdirSync(TRAE_WORKSPACE_STORAGE).filter((n) =>
        fs.statSync(path.join(TRAE_WORKSPACE_STORAGE, n)).isDirectory())
    : [];
if (!dirs.length) console.warn('workspaceStorage has no workspace directories yet.');

Try / catch

try {
    const rows = await runWorkspacesList();
} catch (e) {
    if (/No workspace storage entries/.test(e.message)) {
        return []; // empty is normal on fresh installs
    }
    throw e;
}

Prevention

When it happens

Trigger: workspaceStorage folder exists (possibly recreated empty by Trae) but no workspace was ever opened; all workspace directories were deleted by cleanup; only files (not directories) present in the folder.

Common situations: Trae freshly installed or reinstalled with an empty storage root; a cache cleaner removed workspace directories; inspecting a backup copy where only the top-level folder was preserved.

Related errors


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