From a7d30f73ca304416be31ae843774393f4831a1fc Mon Sep 17 00:00:00 2001 From: guangyang1206 Date: Wed, 13 May 2026 19:09:22 +0800 Subject: [PATCH] fix(frontend): make rerank model optional in agent editor save The runtime chat pipeline (internal/application/service/chat_pipeline/rerank.go:56) already skips rerank when rerank_model_id is empty, so it should not be required at save time. The editor incorrectly required rerank_model_id whenever a RAG KB was selected, even though the field is optional. This fix removes the validation so users can save agents without configuring a rerank model. Fixes #1252 --- frontend/src/views/agent/AgentEditorModal.vue | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/agent/AgentEditorModal.vue b/frontend/src/views/agent/AgentEditorModal.vue index eb51d4761..0f979e04a 100644 --- a/frontend/src/views/agent/AgentEditorModal.vue +++ b/frontend/src/views/agent/AgentEditorModal.vue @@ -3583,12 +3583,9 @@ const handleSave = async () => { return; } - // 校验 ReRank 模型(当需要时必填) - if (needsRerankModel.value && !formData.value.config.rerank_model_id) { - MessagePlugin.error(t('agent.editor.rerankModelRequired')); - currentSection.value = 'knowledge'; - return; - } + // ReRank 模型(可选) + // 运行时若 rerank_model_id 为空会自动跳过 rerank,无需在保存时强制要求。 + // 仅当用户已选择 rerank 模型时,才校验相关参数。 // 过滤空推荐问题 if (formData.value.config.suggested_prompts) {