fix: dimos topic send#2760
Conversation
Greptile SummaryThis PR fixes
Confidence Score: 4/5This is close, but the import failure path should be fixed before merging.
dimos/robot/cli/topic.py Important Files Changed
Reviews (2): Last reviewed commit: "Merge branch 'main' into paul/fix/init-b..." | Re-trigger Greptile |
| except ImportError: | ||
| continue |
There was a problem hiding this comment.
Message Imports Disappear Silently
When a discovered message module has a missing import-time dependency, this branch skips it and removes that message class from the eval context. A valid command such as sending a class from that module then fails later with NameError instead of reporting the module import failure, so dimos topic send remains broken for those message types.
❌ 2 Tests Failed:
View the top 1 failed test(s) by shortest run time
View the full list of 1 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
leshy
left a comment
There was a problem hiding this comment.
needs to become proto agnostic now with zenoh
| try: | ||
| submodule = importlib.import_module(f"{package_name}.{name}") | ||
| except ImportError: | ||
| continue |
There was a problem hiding this comment.
This still hides import-time failures from discovered message modules. When a message file is found but one of its dependencies is missing, importlib.import_module() raises ImportError, this branch skips the module, and the message class never enters the eval context. A command like topic_send("/camera", "Image(...)") then reports name 'Image' is not defined instead of the real missing import, so valid message types can still fail with a misleading parse error.
| try: | |
| submodule = importlib.import_module(f"{package_name}.{name}") | |
| except ImportError: | |
| continue | |
| submodule = importlib.import_module(f"{package_name}.{name}") |
dimos topic sendhas been broken for certain messages since I removed__init__.pyfiles.Closes DIM-1124