jackwener/OpenCLI · warning · EmptyResultError

No keys match "${flt}".

Error message

No keys match "${flt}".

What it means

EmptyResultError thrown by kimi storage-keys when, after reading all entries from the chosen store and optionally filtering by substring, the result set is empty. The message distinguishes the filtered case ('No keys match "X".') from an entirely empty store ('<store> is empty.').

Source

Thrown at clis/kimi/storage.js:59

    ],
    columns: STORAGE_COLUMNS,
    func: async (page, kwargs) => {
        await ensureOnKimi(page);
        const store = pickStore(kwargs);
        const raw = await page.evaluate(`(() => {
      const s = ${store};
      const out = [];
      for (let i = 0; i < s.length; i++) {
        const k = s.key(i);
        const v = s.getItem(k) || '';
        out.push({ k, bytes: v.length });
      }
      return out;
    })()`);
        const flt = kwargs?.filter ? String(kwargs.filter).toLowerCase() : null;
        const filtered = flt ? raw.filter((r) => r.k.toLowerCase().includes(flt)) : raw;
        if (!filtered.length) {
            throw new EmptyResultError('kimi storage-keys', flt ? `No keys match "${flt}".` : `${store} is empty.`);
        }
        filtered.sort((a, b) => a.k.localeCompare(b.k));
        const limit = Number.isInteger(kwargs?.limit) && kwargs.limit > 0 ? kwargs.limit : 100;
        return filtered.slice(0, limit).map((r, i) => ({ Index: i + 1, Key: r.k, Bytes: r.bytes }));
    },
});

// -------- storage-get --------
cli({
    site: 'kimi',
    name: 'storage-get',
    access: 'read',
    description: 'Read a single localStorage / sessionStorage value on kimi.com. Auto-decodes JSON.',
    domain: KIMI_DOMAIN,
    strategy: Strategy.COOKIE,
    browser: true,
    siteSession: 'persistent',
    navigateBefore: false,

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Run without --filter first to list all keys and confirm what actually exists
  2. Check you targeted the right store (--storage session vs local)
  3. Loosen or correct the filter substring; it is a case-insensitive substring match on key names
  4. Clear your assumption by reading storage-get for a known key to verify the store is the right one

Example fix

// before
await kimi(['storage', 'keys', '--filter', 'kimi_token']);
// after
const all = await kimi(['storage', 'keys']); // inspect actual key names
const match = all.find(k => k.Key.includes('token'));
if (match) await kimi(['storage', 'get', '--key', match.Key]);
Defensive patterns

Strategy: fallback

Validate before calling

// check the store is non-empty before applying a filter
const all = await kimi(['storage', 'keys']);
if (!all.length) console.warn('store is empty; filter will match nothing');

Type guard

const hasMatches = (rows) => Array.isArray(rows) && rows.length > 0;

Try / catch

try {
  return await kimi(['storage', 'keys', '--filter', flt]);
} catch (e) {
  if (/No keys match/.test(e.message)) {
    return await kimi(['storage', 'keys']); // fall back to unfiltered listing
  }
  throw e;
}

Prevention

When it happens

Trigger: Running `kimi storage keys --filter <substring>` when no key in localStorage/sessionStorage contains that substring (case-insensitive), or running with no filter when the store has zero entries.

Common situations: Assuming Kimi stores data under names it doesn't use, filtering with the wrong substring or wrong --storage target (data lives in sessionStorage but you read localStorage), or a fresh profile/browser with no stored keys yet.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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