feat(porcelain): discover modules by typed RPC specs - #4009
Open
TomCC7 wants to merge 1 commit into
Open
Conversation
1 task
❌ 7 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
TomCC7
marked this pull request as ready for review
September 8, 2026 22:12
TomCC7
requested review from
Dreamsorcerer,
aclauer,
leshy,
mustafab0,
paul-nechifor and
spomichter
as code owners
September 8, 2026 22:12
Contributor
| def get_module(self, name: str) -> ModuleHandle: | ||
| """Return a module proxy by exact instance name or unique class name.""" | ||
| @overload | ||
| def get_module(self, name: Callable[..., S], *, instance_name: str | None = None) -> S: ... |
Contributor
There was a problem hiding this comment.
You say "Clients should be able to find a module by its Spec"
But then add find_module_by_spec, don't overload get_module.
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.
Contribution path
Split from #3944. Related discussion: #3923
Problem
Clients should be able to find a module by its Spec without also knowing its implementation name.
Solution
app.get_module(MySpec)finds the deployed module whose RPC signatures match the Spec, using the same checks as blueprint wiring.Multiple matches require
instance_name=. The module's class must be importable in the client. Name-based lookup still works.The Arm SDK in #3944 builds on this change.
How to test
Use this branch's provisioned environment. Run only one blueprint on the transport bus.
In terminal one, start the mock dual-arm stack:
source .venv/bin/activate dimos run dual-xarm6-planner-coordinatorOnce startup finishes, open a shell in terminal two:
source .venv/bin/activate dimos shellFind the motion module by Spec:
You should see the left and right planning groups. This does not move either arm.
Check that name-based and explicit-instance lookup return the same proxy:
Both expressions should return
True.Check a missing instance:
This should raise
LookupError.Exit the shell, reopen it, and repeat the first lookup. The runtime should still be running. When finished, exit the shell and stop the test runtime with Ctrl-C in terminal one.
AI assistance
Codex (GPT-5-based coding agent) implemented the change with user direction.
Checklist