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
This commit is contained in:
guangyang1206
2026-05-13 19:09:22 +08:00
committed by lyingbug
parent 6e6d61d945
commit a7d30f73ca
@@ -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) {