Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

feat(parser): 默认不限制目录导入文件数 (#5242)

bot-of-qin-ctx9dea6d3742e6
diff --git a/docs/en/configuration/01-server.md b/docs/en/configuration/01-server.md
index cee9556b5..f5dca04a1 100644
--- a/docs/en/configuration/01-server.md
+++ b/docs/en/configuration/01-server.md
@@ -373,7 +373,7 @@ Parsers live under `parsers`:
"text": {},
"directory": {
"preserve_structure": true,
- "max_files": 1000,
+ "max_files": null,
"max_depth": 10,
"max_concurrent": 4
},
@@ -388,8 +388,8 @@ Parsers live under `parsers`:
}
```
-`parsers.directory.max_files` defaults to `1000`; explicitly set it to `null`
-to disable the file-count limit. Other values must be positive integers.
+`parsers.directory.max_files` defaults to `null`, meaning no file-count limit.
+Set it to a positive integer to limit the number of files per directory import.
`parsers.directory.max_concurrent` is shared by all directory imports in the
server event loop. With the default value `4`, one directory can run four
diff --git a/docs/zh/configuration/01-server.md b/docs/zh/configuration/01-server.md
index 72cf958d0..c6194f9a3 100644
--- a/docs/zh/configuration/01-server.md
+++ b/docs/zh/configuration/01-server.md
@@ -373,7 +373,7 @@ Provider 和密钥管理配置见[加密指南](../guides/08-encryption.md)。
"text": {},
"directory": {
"preserve_structure": true,
- "max_files": 1000,
+ "max_files": null,
"max_depth": 10,
"max_concurrent": 4
},
@@ -388,8 +388,8 @@ Provider 和密钥管理配置见[加密指南](../guides/08-encryption.md)。
}
```
-`parsers.directory.max_files` 默认是 `1000`;显式设为 `null` 表示不限文件数,
-其他值必须是正整数。
+`parsers.directory.max_files` 默认是 `null`,表示不限文件数;
+设为正整数可限制单次目录导入的文件数。
`parsers.directory.max_concurrent` 由服务事件循环中的所有目录导入共享。默认值为
`4` 时,单个目录可以并发执行 4 个 Understanding 任务;多个目录同时导入时,合计仍最多
diff --git a/openviking_cli/utils/config/parser_config.py b/openviking_cli/utils/config/parser_config.py
index 34a8f0a9c..a7cd64d4c 100644
--- a/openviking_cli/utils/config/parser_config.py
+++ b/openviking_cli/utils/config/parser_config.py
@@ -587,7 +587,7 @@ class DirectoryConfig(ParserConfig):
relative path hierarchy. When False, all files are flattened to a
single level under the resource root.
max_files: Optional maximum number of selected files admitted by one
- Understanding or Feishu directory import. None means unlimited.
+ Understanding or Feishu directory import. None (default) means unlimited.
max_depth: Maximum nested directory depth below an Understanding directory
import root.
max_concurrent: Maximum concurrent Understanding jobs shared by all
@@ -595,7 +595,7 @@ class DirectoryConfig(ParserConfig):
"""
preserve_structure: bool = True
- max_files: Optional[int] = 1000
+ max_files: Optional[int] = None
max_depth: int = 10
max_concurrent: int = 4
diff --git a/tests/test_config_loader.py b/tests/test_config_loader.py
index 300c1c154..7f0717d68 100644
--- a/tests/test_config_loader.py
+++ b/tests/test_config_loader.py
@@ -195,10 +195,10 @@ def test_parser_api_upload_defaults():
assert config.upload_part_size_bytes == 8 * 1024 * 1024
-def test_directory_safety_limits_have_bounded_defaults():
+def test_directory_safety_limit_defaults():
config = DirectoryConfig()
- assert config.max_files == 1000
+ assert config.max_files is None
assert config.max_depth == 10
assert config.max_concurrent == 4