Skip to content

feat(platform): let operators size the crawler's document fetch cap - #3999

Merged
larryro merged 1 commit into
mainfrom
feat/crawl-document-max-bytes
Sep 30, 2026
Merged

larryro merged 1 commit into
mainfrom
feat/crawl-document-max-bytes

Conversation

@larryro

@larryro larryro commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Why

The website crawler refused any linked document over a fixed 25 MiB (DOCUMENT_MAX_BYTES) with response_too_large — "The page is too large to fetch." A 26.0 MiB brochure PDF on a crawled site hit it, and there was no way to change the number short of a code change.

What

  • KNOWLEDGE_CRAWL_DOCUMENT_MAX_BYTES (new, optional) is the largest document — PDF, DOCX, XLSX, PPTX, ODT, in bytes — the crawler downloads and extracts; a larger one is still recorded on its page as too large. Read once at boot (crawlDocumentMaxBytes, backend/core/knowledge/crawl_limits.ts), the way the knowledge index repair reads its own byte limit.
  • Default raised from 25 MiB to 100 MiB, the platform's document-upload allowance: what a member could upload can also be crawled. HTML pages keep their own 2 MiB budget.
  • A value below 1 MiB, or not a whole number, is refused with a warning and reads the default — never a silently tiny or infinite cap.
  • Docs: crawling.md en/de/fr (the two places that said 25 MiB), the environment reference en/de/fr (a row in the Database section, noting that every fetch is held in memory while its text is extracted and that up to five sites scan at once), .env.example, the manual automation register.

Proof

  • crawl_limits.test.ts: unset/empty → default, a whole number at or above the floor is taken, abc / 1.5 / -1 / 0 / 1024 / 25MiB warn and read the default.
  • Platform typecheck, lint, crawl unit tests (111), docs tests (222), lint:manual, the CLI's platform-docs guard.

The website crawler refused any document over a fixed 25 MiB with response_too_large, and a 26 MiB brochure PDF had no way in. The cap is now KNOWLEDGE_CRAWL_DOCUMENT_MAX_BYTES, read once at boot, with a default of 100 MiB — the platform's document-upload allowance, so what a member could upload can also be crawled. A value below 1 MiB or not a whole number is refused with a warning and reads the default. Every fetch is held in memory while its text is extracted, up to five sites at once; the environment reference says so. Docs en/de/fr (crawling, environment reference), .env.example and the manual automation register follow.
@larryro
larryro merged commit 4d14c55 into main Sep 30, 2026
53 checks passed
@larryro
larryro deleted the feat/crawl-document-max-bytes branch September 30, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant