jackwener/OpenCLI · warning · EmptyResultError

antigravity state-keys: No keys match "${flt}".

Error message

antigravity state-keys: No keys match "${flt}".

What it means

state-keys resolved the state.vscdb (global or per-workspace), listed all ItemTable keys via sqlite3, applied the case-insensitive --filter, and found zero matches — so EmptyResultError is thrown. The message distinguishes a filtered miss ('No keys match "<flt>"') from a genuinely empty DB ('No keys.').

Source

Thrown at clis/antigravity/storage.js:213

    site: 'antigravity',
    name: 'state-keys',
    access: 'read',
    description: 'List keys in Antigravity\'s globalStorage state.vscdb (VSCode-style). Pass --workspace <id> to query a per-workspace DB. Works while Antigravity is closed.',
    domain: 'localhost',
    strategy: Strategy.LOCAL,
    browser: false,
    args: [
        { name: 'filter', required: false, help: 'Case-insensitive substring filter over keys' },
        { name: 'workspace', required: false, help: 'Workspace id (from workspaces-list) to query per-workspace DB' },
        { name: 'limit', type: 'int', required: false, default: 200, help: 'Max rows to return' },
    ],
    columns: STORAGE_COLUMNS,
    func: async (args) => {
        const db = resolveStateDb(args);
        const keys = listKeys(db);
        const flt = args?.filter ? String(args.filter).toLowerCase() : null;
        const filtered = flt ? keys.filter((k) => k.toLowerCase().includes(flt)) : keys;
        if (!filtered.length) throw new EmptyResultError('antigravity state-keys', flt ? `No keys match "${flt}".` : 'No keys.');
        const limit = Number.isInteger(args?.limit) && args.limit > 0 ? args.limit : 200;
        return filtered.slice(0, limit).map((k, i) => ({ Index: i + 1, Key: k }));
    },
});

// ====== FS-side: state-get ======
cli({
    site: 'antigravity',
    name: 'state-get',
    access: 'read',
    description: 'Read one value from Antigravity\'s state.vscdb. Pass --workspace <id> for per-workspace.',
    domain: 'localhost',
    strategy: Strategy.LOCAL,
    browser: false,
    args: [
        { name: 'key', positional: true, required: true, help: 'Storage key name' },
        { name: 'workspace', required: false, help: 'Workspace id (from workspaces-list) to query per-workspace DB' },
        { name: 'max-bytes', type: 'int', required: false, default: 8000, help: 'Truncate value to this many chars' },

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Run without --filter to see every key, then narrow.
  2. Shorten the filter to a small distinctive substring (e.g. 'history').
  3. Drop --workspace to search the global DB, or add it to search the workspace DB — the key sets differ.
  4. If looking for user settings, use `opencli antigravity settings-read` instead.

Example fix

// before
opencli antigravity state-keys --filter history.recentlyOpenedPathsList
// after
opencli antigravity state-keys --filter history
Defensive patterns

Strategy: fallback

Validate before calling

// Confirm the filter substring exists in the unfiltered key list first
const all = execSync('opencli antigravity state-keys', {encoding:'utf8'});
const flt = 'history';
if (!all.toLowerCase().includes(flt.toLowerCase())) console.warn(`filter "${flt}" matches nothing; falling back to full list`);

Type guard

function filterMatchesAnyKey(keys, filter) {
  return Array.isArray(keys) && keys.some((k) => k.toLowerCase().includes(String(filter).toLowerCase()));
}

Try / catch

try {
  run(`opencli antigravity state-keys --filter ${flt}`);
} catch (e) {
  if (/No keys match/.test(e.message)) {
    run('opencli antigravity state-keys'); // unfiltered fallback
  } else throw e;
}

Prevention

When it happens

Trigger: `opencli antigravity state-keys --filter workbench.x` where no ItemTable key contains that substring, or filtering a per-workspace DB (--workspace) whose key set differs from the global DB's.

Common situations: Filtering with the full key while keys carry different prefixes/casing, querying a fresh workspace DB that has almost no keys, or expecting settings.json values (use settings-read) when they are not stored in ItemTable.

Related errors


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