fix(tui): reduce noisy MCP autocomplete matches (#33176)

This commit is contained in:
Dax 2026-06-21 04:24:59 +02:00 committed by GitHub
parent d3bbfff826
commit f12ac6f234
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -359,9 +359,8 @@ export function Autocomplete(props: {
const width = props.anchor().width - 4
for (const res of Object.values(sync.data.mcp_resource)) {
const text = `${res.name} (${res.uri})`
options.push({
display: Locale.truncateMiddle(text, width),
display: Locale.truncateMiddle(res.name, width),
// Match the name only; matching the URI caused unrelated fuzzy hits.
value: res.name,
description: res.description,
@ -497,6 +496,7 @@ export function Autocomplete(props: {
...(store.visible === "/" ? ["description" as const] : []),
(obj) => obj.aliases?.join(" ") ?? "",
],
threshold: store.visible === "@" ? 0.5 : 0,
limit: 10,
scoreFn: (objResults) => {
const displayResult = objResults[0]