Repository navigation
fix: sync and index MDX documentation in knowledge bases - #2556
Merged
pancacake merged 1 commit intoNov 15, 2026
Merged
Conversation
GitHub source sync kept only .md and .markdown, so a docs glob of *.mdx reported success with zero files and left raw/ empty. Re-index then failed because no supported source files were present. Treat .mdx as text next to Markdown in the sync filter, the knowledge-base file router, and the chat attachment list that mirrors it. Fixes HKUDS#2552
4 tasks done
3 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2552
Adding a GitHub documentation source whose glob is
*.mdxfinished withlast_sync_status: successandfiles_synced: 0. Nothing was written under the knowledge baseraw/directory, so Re-index failed withValueError: KB '...' has no source files in raw/ to reindex.The sync filter only kept
.mdand.markdown, so every.mdxpath was dropped before download. Re-index also ignores files whose extension is not inFileTypeRouter, so an.mdxfile placed inraw/directly was skipped as well..mdxis now treated as text next to Markdown:The default GitHub glob stays
*.md, so existing sources do not start pulling.mdxfiles. PageIndex's extension list is unchanged, because it mirrors the formats that provider's document API accepts.This change was AI-assisted and was reviewed and tested.
Test plan
python3 -m pytest tests/services/test_github_source_mdx.py tests/services/rag/test_file_routing.py tests/utils/test_document_extractor.py::TestIsDocumentExtension(54 passed). The new test syncsdocs/with glob*.mdx, writes the file underraw/, and checks that an.mdx-only raw directory is eligible for re-index.python3 -m ruff checkandpython3 -m ruff format --checkon the changed Python files.python3 -m pre_commit run --fileson the changed files (hygiene, ruff, prettier, bandit, mypy).web/tests/doc-attachments.test.ts(15 passed), including.mdxclassification.