diff --git a/agent/knowledge/service.py b/agent/knowledge/service.py index d78ff112..77ed7171 100644 --- a/agent/knowledge/service.py +++ b/agent/knowledge/service.py @@ -35,7 +35,7 @@ class KnowledgeService: IMPORT_EXTENSIONS = {".md", ".txt"} MAX_IMPORT_FILES = 100 MAX_IMPORT_FILE_SIZE = 10 * 1024 * 1024 - MAX_IMPORT_TOTAL_SIZE = 50 * 1024 * 1024 + MAX_IMPORT_TOTAL_SIZE = 200 * 1024 * 1024 def __init__(self, workspace_root: str, memory_manager=None): self.workspace_root = os.path.abspath(workspace_root) diff --git a/channel/web/static/js/console.js b/channel/web/static/js/console.js index cf8a93ef..d14bc531 100644 --- a/channel/web/static/js/console.js +++ b/channel/web/static/js/console.js @@ -7547,7 +7547,7 @@ let _knowledgeCurrentFile = null; let _knowledgeGraphLoaded = false; const KNOWLEDGE_IMPORT_MAX_FILES = 100; const KNOWLEDGE_IMPORT_MAX_FILE_SIZE = 10 * 1024 * 1024; -const KNOWLEDGE_IMPORT_MAX_TOTAL_SIZE = 50 * 1024 * 1024; +const KNOWLEDGE_IMPORT_MAX_TOTAL_SIZE = 200 * 1024 * 1024; function loadKnowledgeView() { // Reset to docs tab @@ -7959,7 +7959,7 @@ function validateKnowledgeImportFiles(files) { } } if (total > KNOWLEDGE_IMPORT_MAX_TOTAL_SIZE) { - return currentLang === 'zh' ? '单次导入总大小不能超过 50MB' : 'Total import size cannot exceed 50MB'; + return currentLang === 'zh' ? '单次导入总大小不能超过 200MB' : 'Total import size cannot exceed 200MB'; } return ''; } diff --git a/tests/test_knowledge_service.py b/tests/test_knowledge_service.py index d1bc9a94..57408167 100644 --- a/tests/test_knowledge_service.py +++ b/tests/test_knowledge_service.py @@ -280,6 +280,7 @@ def test_import_documents_skip_overwrite_and_failures(tmp_path): def test_import_documents_rejects_large_files_and_batches(tmp_path): svc, manager = service(tmp_path) (tmp_path / "knowledge/notes").mkdir() + assert svc.MAX_IMPORT_TOTAL_SIZE == 200 * 1024 * 1024 too_large = svc.dispatch("import_documents", { "target_category": "notes", diff --git a/tests/test_knowledge_web.py b/tests/test_knowledge_web.py index 3dd26092..6ab2dba2 100644 --- a/tests/test_knowledge_web.py +++ b/tests/test_knowledge_web.py @@ -114,6 +114,7 @@ def test_knowledge_import_handler_delegates_to_dispatch(tmp_path): def test_knowledge_import_handler_rejects_large_content_length(tmp_path): from channel.web.web_channel import KnowledgeImportHandler from agent.knowledge.service import KnowledgeService + assert KnowledgeService.MAX_IMPORT_TOTAL_SIZE == 200 * 1024 * 1024 with patch("channel.web.web_channel._require_auth"), \ patch("channel.web.web_channel.web.header"), \