Skip to content

fix: fall back to the bundled config file when DEEPWIKI_CONFIG_DIR lacks it - #630

Merged
sng-asyncfunc merged 1 commit into
AsyncFuncAI:mainfrom
lbarrosby:fix/config-dir-fallback
Nov 12, 2026
Merged

sng-asyncfunc merged 1 commit into
AsyncFuncAI:mainfrom
lbarrosby:fix/config-dir-fallback

Conversation

@lbarrosby

Copy link
Copy Markdown
Contributor

What

load_json_config reads every config file (generator.json, embedder.json, repo.json, lang.json) from DEEPWIKI_CONFIG_DIR when it is set, and returns {} with a warning when the file is not there. So DEEPWIKI_CONFIG_DIR only works if you copy the whole api/config/ directory. The common case of overriding just the providers (a directory or a Kubernetes ConfigMap with only generator.json) silently leaves the other configs empty:

WARNING - Configuration file /custom/embedder.json does not exist
WARNING - Configuration file /custom/repo.json does not exist

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_DIR when present there, and from the bundled api/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 monkeypatching api.config.CONFIG_DIR to a temp dir that holds only generator.json:

  • the custom generator.json is the one loaded;
  • embedder.json comes from the bundled config. This one fails on main ({}) and passes with the change.
$ .venv/bin/python -m pytest tests/test_config.py -q
12 passed, 2 warnings in 1.39s

Full pytest tests: 119 passed. The 3 failures and 3 errors (test_all_embedders.py factory tests, tests/api/test_api.py, tests/test_repository.py) are the same on main in my environment (network/git clone and API keys).

…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>
@sng-asyncfunc
sng-asyncfunc merged commit ddc1eec into AsyncFuncAI:main Nov 12, 2026
3 checks passed
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.

2 participants