fix(docreader): remove default 100-page limit for DOCX parsing

The default DOCREADER_DOCX_MAX_PAGES=100 silently truncates large
documents, causing users to see at most ~1000 chunks regardless of
document length. Change the default to 0 (no limit) so all pages are
processed. Operators who need a cap can still set the env var.

Fixes #719
This commit is contained in:
wizardchen
2026-04-28 21:43:13 +08:00
committed by lyingbug
parent 80a007cc06
commit d5f6c7ba21
3 changed files with 6 additions and 4 deletions
+2
View File
@@ -97,6 +97,8 @@ class DocxParser(BaseParser):
"""
super().__init__(**kwargs)
self.max_pages = CONFIG.docx_max_pages if max_pages is None else max_pages
if self.max_pages <= 0:
self.max_pages = 100000 # no limit (matches Docx.__call__ default)
logger.info(f"DocxParser initialized with max_pages={self.max_pages}")
def parse_into_text(self, content: bytes) -> DocumentModel: