fix(config): merge nested module overrides#2829
Open
TomCC7 wants to merge 2 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #2829 +/- ##
==========================================
+ Coverage 71.91% 71.95% +0.03%
==========================================
Files 979 979
Lines 87346 87374 +28
Branches 7982 7986 +4
==========================================
+ Hits 62819 62870 +51
+ Misses 22387 22383 -4
+ Partials 2140 2121 -19
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Contributor
Greptile SummaryThis PR updates module deployment config merging. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "refactor(config): keep nested merge simp..." | Re-trigger Greptile |
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.
Problem
Module config overrides from blueprints can include nested Pydantic config objects. CLI/config overrides parse dotted keys like
Module.sub.a=1into partial nested dictionaries. Deployment previously applied those overrides with a shallowdict.update, so the partial nested dictionary replaced the whole blueprint-provided nested config. Missing subfields then fell back to class defaults instead of preserving the blueprint defaults.Closes: N/A
Solution
Merge module deployment kwargs recursively before constructing the module config. If the base value is a Pydantic model and the override is a mapping, convert the base model to a Python dict and merge the override into it. Non-mapping override values still replace the base value.
This keeps the change local to Python module deployment and preserves existing scalar override behavior.
How to Test
uv run pytest dimos/core/coordination/test_worker.py -k 'nested_blueprint_config_defaults_survive_cli_override or worker_manager_parallel_deployment' uv run ruff check dimos/core/coordination/worker_manager_python.py dimos/core/coordination/test_worker.pyContributor License Agreement