Skip to content

fix(config): merge nested module overrides#2829

Open
TomCC7 wants to merge 2 commits into
mainfrom
cc/fix/mergible-nested-config
Open

fix(config): merge nested module overrides#2829
TomCC7 wants to merge 2 commits into
mainfrom
cc/fix/mergible-nested-config

Conversation

@TomCC7

@TomCC7 TomCC7 commented Jul 9, 2026

Copy link
Copy Markdown
Member

Problem

Module config overrides from blueprints can include nested Pydantic config objects. CLI/config overrides parse dotted keys like Module.sub.a=1 into partial nested dictionaries. Deployment previously applied those overrides with a shallow dict.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.py

Contributor License Agreement

  • I have read and approved the CLA.

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.32258% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
dimos/core/coordination/worker_manager_python.py 80.00% 1 Missing and 2 partials ⚠️
@@            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     
Flag Coverage Δ
OS-ubuntu-24.04-arm 64.58% <90.32%> (+<0.01%) ⬆️
OS-ubuntu-latest 67.06% <90.32%> (+0.01%) ⬆️
Py-3.10 67.05% <90.32%> (+<0.01%) ⬆️
Py-3.11 67.05% <90.32%> (+<0.01%) ⬆️
Py-3.12 67.06% <90.32%> (+0.01%) ⬆️
Py-3.13 67.04% <90.32%> (+<0.01%) ⬆️
Py-3.14 67.06% <90.32%> (+<0.01%) ⬆️
Py-3.14t 67.04% <90.32%> (-0.01%) ⬇️
SelfHosted-Large 30.11% <61.29%> (+0.01%) ⬆️
SelfHosted-macOS 36.03% <41.93%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
dimos/core/coordination/test_worker.py 99.16% <100.00%> (+0.05%) ⬆️
dimos/core/coordination/worker_manager_python.py 79.77% <80.00%> (+12.09%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@TomCC7 TomCC7 marked this pull request as ready for review July 9, 2026 01:58
@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates module deployment config merging. The main changes are:

  • Recursive merging for nested module kwargs.
  • Pydantic model values converted before nested merging.
  • A regression test for preserving nested blueprint defaults under partial overrides.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
dimos/core/coordination/worker_manager_python.py Adds recursive config-kwargs merging and applies it during Python module deployment.
dimos/core/coordination/test_worker.py Adds coverage for partial nested overrides preserving existing nested config values.

Reviews (2): Last reviewed commit: "refactor(config): keep nested merge simp..." | Re-trigger Greptile

Comment thread dimos/core/coordination/worker_manager_python.py
@TomCC7 TomCC7 marked this pull request as draft July 9, 2026 01:59
@TomCC7 TomCC7 marked this pull request as ready for review July 9, 2026 02:01
@github-actions github-actions Bot added the ready-to-merge Required CI checks have passed on this PR label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Required CI checks have passed on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant