Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.
Go agentagenticaichatbotdsh-pluginembeddingsevaluationgenerative-aigolangknowledge-basellmmulti-tenantollamaopenaiquestion-answeringragrerankingsemantic-searchvector-searchwiki
fix(ui): preserve explicit zero chunk_overlap when loading KB settings (#4274)
Li-john10213f573a490ea1
diff --git a/frontend/src/views/knowledge/KnowledgeBaseEditorModal.vue b/frontend/src/views/knowledge/KnowledgeBaseEditorModal.vueindex 6b8859be7..611a55d4e 100644--- a/frontend/src/views/knowledge/KnowledgeBaseEditorModal.vue+++ b/frontend/src/views/knowledge/KnowledgeBaseEditorModal.vue@@ -1114,7 +1114,7 @@ const loadKBData = async (chunkSize: kb.chunking_config?.chunk_size || 512,// Fallback only used when the loaded KB has no chunk_overlap stored.// Aligned with chunker.DefaultChunkOverlap on the backend.- chunkOverlap: kb.chunking_config?.chunk_overlap || 80,+ chunkOverlap: kb.chunking_config?.chunk_overlap ?? 80,separators: kb.chunking_config?.separators || ['\n\n', '\n', '。', '!', '?', ';', ';'],parserEngineRules: kb.chunking_config?.parser_engine_rules || undefined,enableParentChild: kb.chunking_config?.enable_parent_child || false,diff --git a/frontend/src/views/knowledge/components/UploadConfirmDialog.test.ts b/frontend/src/views/knowledge/components/UploadConfirmDialog.test.tsindex 7b83c1620..28d166cc0 100644--- a/frontend/src/views/knowledge/components/UploadConfirmDialog.test.ts+++ b/frontend/src/views/knowledge/components/UploadConfirmDialog.test.ts@@ -3,6 +3,7 @@ import test from 'node:test'import { readFileSync } from 'node:fs'const dialog = readFileSync(new URL('./UploadConfirmDialog.vue', import.meta.url), 'utf8')+const editor = readFileSync(new URL('../KnowledgeBaseEditorModal.vue', import.meta.url), 'utf8')const host = readFileSync(new URL('../../../components/UploadConfirmHost.vue', import.meta.url), 'utf8')const knowledgeBase = readFileSync(new URL('../KnowledgeBase.vue', import.meta.url), 'utf8')const platform = readFileSync(new URL('../../platform/index.vue', import.meta.url), 'utf8')@@ -78,3 +79,10 @@ test('uses section navigation with inline chunking controls and advanced optionsassert.match(dialog, /data-section="multimodal"/)assert.doesNotMatch(dialog, /<KBChunkingSettings/)})++test('preserves an explicit zero chunk overlap when loading saved settings', () => {+ assert.match(dialog, /chunkOverlap: kb\.chunking_config\?\.chunk_overlap \?\? 80/)+ assert.match(editor, /chunkOverlap: kb\.chunking_config\?\.chunk_overlap \?\? 80/)+ assert.doesNotMatch(dialog, /chunk_overlap \|\| 80/)+ assert.doesNotMatch(editor, /chunk_overlap \|\| 80/)+})diff --git a/frontend/src/views/knowledge/components/UploadConfirmDialog.vue b/frontend/src/views/knowledge/components/UploadConfirmDialog.vueindex 0828d217e..15853de14 100644--- a/frontend/src/views/knowledge/components/UploadConfirmDialog.vue+++ b/frontend/src/views/knowledge/components/UploadConfirmDialog.vue@@ -1270,7 +1270,7 @@ function initFromKbInfo(kb: any) {summaryEnabled: true,chunkingConfig: {chunkSize: kb.chunking_config?.chunk_size || 512,- chunkOverlap: kb.chunking_config?.chunk_overlap || 80,+ chunkOverlap: kb.chunking_config?.chunk_overlap ?? 80,separators: kb.chunking_config?.separators || ['\n\n', '\n', '。', '!', '?', ';', ';'],parserEngineRules: kb.chunking_config?.parser_engine_rules || undefined,enableParentChild: kb.chunking_config?.enable_parent_child ?? false,