Conversation
Greptile SummaryThis PR fixes a longstanding bug in Confidence Score: 4/5Safe to merge — the fix is internally consistent and corrects a real runtime bug; the only open question is whether all Module subclasses expose .blueprint(). The three-file change is coherent: the registry format, the loader, and the generator all move in lock-step. The original code was provably broken (snake_case lookup against CamelCase class names). The new approach is correct. One point deducted because the PR description leaves "How to Test" empty and there is no explicit test covering the new .blueprint() call path. dimos/robot/get_all_blueprints.py — the .blueprint() call assumes all registered Module subclasses expose that method; worth verifying with a small test. Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant get_module_by_name
participant all_modules
participant Python Import
Caller->>get_module_by_name: name = "b-box-navigation-module"
get_module_by_name->>all_modules: lookup name
all_modules-->>get_module_by_name: "dimos.navigation.bbox_navigation.BBoxNavigationModule"
get_module_by_name->>get_module_by_name: rsplit(".", 1) → module_path, class_name
get_module_by_name->>Python Import: __import__(module_path, fromlist=[class_name])
Python Import-->>get_module_by_name: python_module
get_module_by_name->>python_module: getattr(python_module, class_name).blueprint()
python_module-->>Caller: Blueprint
Reviews (1): Last reviewed commit: "fix(blueprints): get module by name" | Re-trigger Greptile |
|
does this change mean we can do something like instead of |
No. It just means |
| def _find_blueprints_in_file( | ||
| file_path: Path, module_classes: set[str] | None = None | ||
| ) -> tuple[list[str], list[str]]: | ||
| ) -> tuple[list[str], list[tuple[str, str]]]: |
There was a problem hiding this comment.
We could use NamedTuple for code readability.
mustafab0
left a comment
There was a problem hiding this comment.
Looks alright to me. Can't find any issues
Problem
In #1606 I broke the ability to get modules by name.
Closes DIM-XXX
Solution
all_modules.Breaking Changes
How to Test
Contributor License Agreement