jackwener/OpenCLI · info · EmptyResultError

antigravity recent-paths: Recent paths list is empty.

Error message

antigravity recent-paths: Recent paths list is empty.

What it means

Thrown by `antigravity recent-paths` when the key `history.recentlyOpenedPathsList` exists in the global state DB but its `entries` array is empty (or absent). Distinct from error 260: the record exists, but there is nothing in the list to render. The library throws an EmptyResultError rather than returning an empty table so callers know the data source was reachable.

Source

Thrown at clis/antigravity/storage.js:269

// ====== FS-side: recent-paths ======
cli({
    site: 'antigravity',
    name: 'recent-paths',
    access: 'read',
    description: 'Show Antigravity\'s recently-opened folders/files (history.recentlyOpenedPathsList).',
    domain: 'localhost',
    strategy: Strategy.LOCAL,
    browser: false,
    args: [
        { name: 'limit', type: 'int', required: false, default: 20, help: 'Max rows to return' },
    ],
    columns: STORAGE_COLUMNS,
    func: async (args) => {
        const val = getValue(AG_GLOBAL_STATE_DB, 'history.recentlyOpenedPathsList');
        if (!val) throw new EmptyResultError('antigravity recent-paths', 'No recent paths recorded.');
        const entries = val.entries || [];
        if (!entries.length) throw new EmptyResultError('antigravity recent-paths', 'Recent paths list is empty.');
        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.fileUri) {
                kind = 'file';
                target = decodeURI(String(e.fileUri).replace(/^file:\/\//, ''));
            } else if (e.workspace?.configPath) {
                kind = 'workspace';
                target = decodeURI(String(e.workspace.configPath).replace(/^file:\/\//, ''));
            }
            return { Index: i + 1, Kind: kind, Path: target };
        });
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Open some files or folders in Antigravity to populate the recent list, then rerun
  2. Inspect the value: sqlite3 state.vscdb "SELECT value FROM ItemTable WHERE key='history.recentlyOpenedPathsList';" to confirm entries is empty
  3. If the list was cleared accidentally, restore state.vscdb from a backup
Defensive patterns

Strategy: fallback

Validate before calling

const raw = execFileSync('/usr/bin/sqlite3',
  [dbPath, "SELECT value FROM ItemTable WHERE key='history.recentlyOpenedPathsList';"],
  { encoding: 'utf-8' }).trim();
const val = raw ? JSON.parse(raw) : null;
if (!val?.entries?.length) console.log('Recent list empty; proceeding with defaults.');

Type guard

function hasEntries(v) {
  return v != null && typeof v === 'object' && Array.isArray(v.entries) && v.entries.length > 0;
}

Try / catch

try {
  await cli.run(['antigravity', 'recent-paths']);
} catch (e) {
  if (e.name === 'EmptyResultError') return { entries: [] }; // graceful empty fallback
  throw e;
}

Prevention

When it happens

Trigger: Running `opencli antigravity recent-paths` when val exists but `val.entries` is missing or has length 0 in AG_GLOBAL_STATE_DB.

Common situations: User cleared 'recently opened' from within Antigravity; state was reset by an update or profile migration; the key exists from a template but was never populated.

Related errors


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