From f12ac6f234ebe31982ee78f3359e8170cb09ffc9 Mon Sep 17 00:00:00 2001 From: Dax Date: Sun, 21 Jun 2026 04:24:59 +0200 Subject: [PATCH] fix(tui): reduce noisy MCP autocomplete matches (#33176) --- packages/tui/src/component/prompt/autocomplete.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tui/src/component/prompt/autocomplete.tsx b/packages/tui/src/component/prompt/autocomplete.tsx index 6fae556fc..f2916173d 100644 --- a/packages/tui/src/component/prompt/autocomplete.tsx +++ b/packages/tui/src/component/prompt/autocomplete.tsx @@ -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]