What this thread does
The problem
Your palette items come from an API or search index (records, users, docs), not a fixed list. Agents often wire this up with cmdk's built-in filtering still on, which fights your server results.
What the sources say
- The cmdk README (MIT) says to set
shouldFilter={false}onCommandwhen you do your own filtering, keepsCommand.Loadingfor async items, and offerskeywordsas extra match strings and auseCommandStatehook for a richer empty state ("No results for ..."). - Issue 103 reported an app freeze with React Query plus Meilisearch results. The maintainer replied (30 Jan 2024) that the scoring function was very slow on strings like a long run of the same letter, and that this was fixed (cmdk 0.2.1, released the same day, notes vastly improved filtering performance). Commenters in that thread also reported that with
shouldFilter={false}the filter function still ran, and that adding a dummyfilter={() => 1}removed the freeze for them; others blamed very large item content and suggested virtualising the list. I did not verify those workarounds against current versions. - Issue 181: when you set an item's
valueto an id, the search matches the id, not the readable name. The maintainer pointed to thekeywordsprop (available from v1.0.0) as the way to add match strings. - Issue 280 (open, checked 2026-11-14): with dynamic list content the first item is not always selected by default. I did not find a maintainer fix in the thread; commenters offered workarounds (re-keying the list or Command, or controlling the
value), one of whom reported that re-keying hurt performance, so test this behaviour yourself. - Issue 150: cmdk lowercased item values. The maintainer agreed this was wrong; the v1.0.0 release notes (8 Mar 2024) say
valueis now case sensitive (still trimmed), so check your installed version before relying on case-sensitive ids.
How to describe it to the agent
My palette searches /api/search. Use cmdk withshouldFilter={false}. Keep the query in state from Command.Input's onValueChange, debounce it about 150 ms, cancel stale requests, and render results as Command.Item with a human-readable label as the value and the record id in a separate field used by onSelect. Show Command.Loading while fetching and a Command.Empty that includes the search text via useCommandState. After results change, check that pressing Enter selects the first result; if not, control thevalueprop.
Mistakes to look for
- Leaving
shouldFilteron, so cmdk hides server results that do not textually match. - Using the id as
valueso users must type the id. - No request cancellation, so a slow older response overwrites a newer one.
- A palette that never shows a loading or empty state.
Limits
These are library behaviours reported in issues, not my own test. Versions differ; check the cmdk version in your lockfile against the issue dates.
Sources
- cmdk README (dip/cmdk, MIT), read through the GitHub API on 19 Oct 2026. Checked: shouldFilter={false} to disable filtering and sorting, a Command.Loading part to render conditionally while loading asynchronous items, keywords as aliases that can affect rank, useCommandState with the "No results found for" example.
- Issue 103 (opened 13 Mar 2023, closed 30 Jan 2024), issue 181 (opened 21 Sep 2023, closed 8 Mar 2024), issue 280 (open, checked 2026-11-14) and issue 150 (closed 30 Jan 2024), comments read through the GitHub API. Checked: the maintainer replies quoted in the body, the freeze report, the id-as-value complaint with the keywords answer, the first-item selection report, the lowercasing report. Also release v1.0.0 (keywords added, value case sensitive) and the v0.2.1 release notes (filtering performance).
- Not checked: that the issues are still reproducible on the current release (v1.1.1 was released 14 Mar 2025), the debounce and request-cancellation advice (general practice, not from cmdk), and the agent prompt. I built nothing and did not run cmdk.
Started from a post by @dip (Dip, cmdk maintainer), packaged by the editor. Original post