From f58139a9454516dfd9ce8656b5f2f9c01c982f97 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Wed, 13 May 2026 00:33:51 +0800 Subject: [PATCH] fix(frontend): persist graph extract toggle state on KB save (#1297) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "启用实体关系提取" switch in GraphSettings was silently dropped on save: buildSubmitData only attached extract_config to the request when both indexingStrategy.graphEnabled AND nodeExtractConfig.enabled were true. When the graph indexing strategy was off (the default), the toggle change never reached the backend and reloading the KB always showed the switch as off. Always emit extract_config based on the user's actual toggle state so the value round-trips correctly through updateKBConfig regardless of the indexing strategy selection. --- .../views/knowledge/KnowledgeBaseEditorModal.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/frontend/src/views/knowledge/KnowledgeBaseEditorModal.vue b/frontend/src/views/knowledge/KnowledgeBaseEditorModal.vue index c9d75ef59..32f385856 100644 --- a/frontend/src/views/knowledge/KnowledgeBaseEditorModal.vue +++ b/frontend/src/views/knowledge/KnowledgeBaseEditorModal.vue @@ -934,14 +934,15 @@ const buildSubmitData = () => { } } - // Sync extract_config.enabled from indexingStrategy.graphEnabled - if (formData.value.indexingStrategy?.graphEnabled && formData.value.nodeExtractConfig?.enabled) { + // Always persist extract_config so the toggle state from GraphSettings is saved, + // regardless of whether the graph indexing strategy is currently enabled. + if (formData.value.nodeExtractConfig) { data.extract_config = { - enabled: true, - text: formData.value.nodeExtractConfig.text, - tags: formData.value.nodeExtractConfig.tags, - nodes: formData.value.nodeExtractConfig.nodes, - relations: formData.value.nodeExtractConfig.relations + enabled: !!formData.value.nodeExtractConfig.enabled, + text: formData.value.nodeExtractConfig.text || '', + tags: formData.value.nodeExtractConfig.tags || [], + nodes: formData.value.nodeExtractConfig.nodes || [], + relations: formData.value.nodeExtractConfig.relations || [] } }