Skip to content

fix(core): resolve remap targets through subclasses - #3233

Open
mustafab0 wants to merge 1 commit into
mainfrom
fix-remap-instance-key
Open

fix(core): resolve remap targets through subclasses#3233
mustafab0 wants to merge 1 commit into
mainfrom
fix-remap-instance-key

Conversation

@mustafab0

Copy link
Copy Markdown
Contributor

Problem

A blueprint can rename a module's port so two modules connect.

That rename is looked up by class. If a blueprint subclasses the module — which the new
per-robot joint streams need — the lookup misses and the rename never happens. Nothing
errors and nothing warns. You get a G1 that boots fine and ignores every nav and WASD
command.

Issue: #


Solution

If the exact class isn't in the blueprint, look for a subclass of it instead.

Exact match is still tried first. Some modules that get deployed together inherit from
each other (ObjectDBModule extends Detection3DModule), and there you meant the class
you actually named.

Renaming a module that isn't in the blueprint used to do nothing, quietly. It now raises.


Breaking Changes

None. All 139 importable blueprints resolve identically. .remappings() on an absent
module now raises; nothing in-repo does that.


How to Test

  1. pytest dimos/core/coordination/test_module_coordinator.py -k remap
  2. pytest dimos/core dimos/robot -m 'not (tool or self_hosted or mujoco or self_hosted_large)'
  3. Drop the exact-match preference and unitree-g1-detection fails; revert to is and the subclass test fails.

@mustafab0 mustafab0 added the backport:skip Skip creating a backport to any release branches label Jul 28, 2026
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #3233   +/-   ##
=======================================
  Coverage   74.96%   74.97%           
=======================================
  Files        1117     1117           
  Lines      106875   106898   +23     
  Branches     9699     9701    +2     
=======================================
+ Hits        80124    80145   +21     
- Misses      23943    23944    +1     
- Partials     2808     2809    +1     
Flag Coverage Δ
OS-ubuntu-24.04-arm 68.54% <100.00%> (+<0.01%) ⬆️
OS-ubuntu-latest 70.64% <100.00%> (+<0.01%) ⬆️
Py-3.10 70.63% <100.00%> (+<0.01%) ⬆️
Py-3.11 70.63% <100.00%> (+<0.01%) ⬆️
Py-3.12 70.63% <100.00%> (+<0.01%) ⬆️
Py-3.13 70.64% <100.00%> (+<0.01%) ⬆️
Py-3.14 70.64% <100.00%> (+<0.01%) ⬆️
Py-3.14t 70.63% <100.00%> (+<0.01%) ⬆️
SelfHosted-Large 29.23% <16.66%> (-0.01%) ⬇️
SelfHosted-Linux 35.80% <16.66%> (-0.01%) ⬇️
SelfHosted-macOS 34.89% <16.66%> (+<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/blueprints.py 88.80% <100.00%> (+0.18%) ⬆️
dimos/core/coordination/test_module_coordinator.py 99.56% <100.00%> (+0.01%) ⬆️

... and 1 file 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.

@github-actions github-actions Bot added the ready-to-merge Required CI checks have passed on this PR label Jul 28, 2026
@mustafab0 mustafab0 changed the title fix(core): resolve remap targets through subclasses instead of silent… fix(core): resolve remap targets through subclasses Jul 28, 2026
@mustafab0
mustafab0 force-pushed the fix-remap-instance-key branch from 27e80d1 to c7ff853 Compare July 28, 2026 18:53
@github-actions github-actions Bot added ready-to-merge Required CI checks have passed on this PR and removed ready-to-merge Required CI checks have passed on this PR labels Jul 28, 2026
…ly missing

Blueprint.remappings() converts the module you name into an instance-name
string, and _instance_key matched atoms with `is`. A deployment that
subclasses a module to declare extra ports (the per-robot joint-stream
pattern) therefore stopped matching, and the miss was silent: remapping_map
is read with .get(key, original_name), so the rename just did not happen.
On unitree-g1-groot-wbc that would have left the coordinator listening on
twist_command while the nav stack published cmd_vel — no error, no command
path.

Exact class match still wins, because sibling modules inherit from each
other too (ObjectDBModule is a Detection3DModule) and both get deployed;
subclasses are only consulted when no atom matches exactly. Naming a module
that is not in the blueprint now raises instead of guessing a name that
matches nothing.
@mustafab0
mustafab0 force-pushed the fix-remap-instance-key branch from c7ff853 to a81a7b2 Compare July 28, 2026 21:19
@github-actions github-actions Bot added ready-to-merge Required CI checks have passed on this PR and removed ready-to-merge Required CI checks have passed on this PR labels Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip Skip creating a backport to any release branches 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