From d48d8163a71e8dfbda3fcb0a92e91ac82f8efd50 Mon Sep 17 00:00:00 2001 From: Zoe Date: Sun, 27 Sep 2026 09:45:19 -0500 Subject: [PATCH] feat: remove search rerank --- app/components/ChatInput.vue | 11 +- app/components/Message/Agent/Tool/Search.vue | 29 ++- app/components/SearchSelector.vue | 85 +------- app/components/Settings/SystemAssistants.vue | 30 ++- app/components/Tooltip.vue | 3 +- app/components/TooltipProvider.vue | 5 +- app/composables/useChat.ts | 20 -- app/composables/useTooltip.ts | 6 +- app/utils/tool-rendering.ts | 18 ++ drizzle/schema.ts | 6 - server/api/agent/[id]/index.patch.ts | 2 - server/api/settings/index.get.ts | 9 +- server/api/settings/index.patch.ts | 27 ++- server/api/topic/[topicId]/chat/index.post.ts | 186 +++--------------- server/utils/ai-provider.ts | 8 - server/utils/search.ts | 52 +++++ tests/search.test.ts | 82 ++++++++ 17 files changed, 243 insertions(+), 336 deletions(-) create mode 100644 server/utils/search.ts create mode 100644 tests/search.test.ts diff --git a/app/components/ChatInput.vue b/app/components/ChatInput.vue index d7a4744..bdee850 100644 --- a/app/components/ChatInput.vue +++ b/app/components/ChatInput.vue @@ -46,8 +46,6 @@ const props = defineProps<{ const searchConfig = ref({ enabled: props.agent?.config?.search?.enabled ?? false, - maxResults: props.agent?.config?.search?.maxResults ?? 10, - rerank: props.agent?.config?.search?.rerank ?? false, }); const toolsConfig = ref({ @@ -57,8 +55,6 @@ const toolsConfig = ref({ watch(() => props.agent?.config?.search, (val) => { searchConfig.value = { enabled: val?.enabled ?? false, - maxResults: val?.maxResults ?? 10, - rerank: val?.rerank ?? false, }; }, { deep: true }); @@ -79,8 +75,6 @@ const saveAgentConfig = async (partial: { ...(partial.search !== undefined ? { search: { enabled: partial.search.enabled, - maxResults: partial.search.maxResults, - rerank: partial.search.rerank, }, } : {}), ...(partial.tools !== undefined ? { @@ -414,10 +408,7 @@ onUnmounted(() => { + @update:enabled="(v: boolean) => { searchConfig.enabled = v; saveSearchConfig() }" /> diff --git a/app/components/Message/Agent/Tool/Search.vue b/app/components/Message/Agent/Tool/Search.vue index e727d00..07b9313 100644 --- a/app/components/Message/Agent/Tool/Search.vue +++ b/app/components/Message/Agent/Tool/Search.vue @@ -8,6 +8,7 @@ import { getFaviconUrl, parseToolValue, readSearchSources, + readSearchWarnings, } from "~/utils/tool-rendering"; const props = defineProps<{ @@ -19,7 +20,10 @@ const emit = defineEmits<{ retry: []; }>(); -const sources = computed(() => readSearchSources(parseToolValue(props.toolCall.output))); +const output = computed(() => parseToolValue(props.toolCall.output)); +const sources = computed(() => readSearchSources(output.value)); +const warnings = computed(() => readSearchWarnings(output.value)); +const warningSummary = computed(() => warnings.value.map(warning => `${warning.engine}: ${warning.reason}`).join("; ")); const query = computed(() => { const input = parseToolValue(props.toolCall.input); @@ -103,6 +107,17 @@ const customTab = computed(() => { @retry="emit('retry')" > diff --git a/app/components/SearchSelector.vue b/app/components/SearchSelector.vue index 630d819..2bf4d3e 100644 --- a/app/components/SearchSelector.vue +++ b/app/components/SearchSelector.vue @@ -1,39 +1,9 @@ -