Repository navigation
fix: fall back to the bundled config file when DEEPWIKI_CONFIG_DIR lacks it - #630
Merged
sng-asyncfunc merged 1 commit intoNov 12, 2026
Merged
Conversation
…cks it With DEEPWIKI_CONFIG_DIR set, every JSON config was read only from that directory, so a directory holding just a custom generator.json left embedder.json, repo.json and lang.json empty: no embedder, no file filters. Read each file from DEEPWIKI_CONFIG_DIR when it is there and from api/config otherwise. Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
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.
What
load_json_configreads every config file (generator.json,embedder.json,repo.json,lang.json) fromDEEPWIKI_CONFIG_DIRwhen it is set, and returns{}with a warning when the file is not there. SoDEEPWIKI_CONFIG_DIRonly works if you copy the wholeapi/config/directory. The common case of overriding just the providers (a directory or a Kubernetes ConfigMap with onlygenerator.json) silently leaves the other configs empty:and then there is no embedder config (indexing fails) and no default file filters (
node_modules,.git, lock files... get indexed).Now each file is taken from
DEEPWIKI_CONFIG_DIRwhen present there, and from the bundledapi/config/otherwise (logged at info level). A full copy of the directory behaves exactly as before.Tests
Two tests in
tests/test_config.py, both monkeypatchingapi.config.CONFIG_DIRto a temp dir that holds onlygenerator.json:generator.jsonis the one loaded;embedder.jsoncomes from the bundled config. This one fails onmain({}) and passes with the change.Full
pytest tests: 119 passed. The 3 failures and 3 errors (test_all_embedders.pyfactory tests,tests/api/test_api.py,tests/test_repository.py) are the same onmainin my environment (network/git clone and API keys).