fix: scope a2a alias finder to submodules only

The shim's MetaPathFinder matched the crewai.a2a root, so
importlib.reload(crewai.a2a) would swap the shim module for
crewai_a2a and drop the shim's __all__ re-exports.
This commit is contained in:
Greyson LaLonde
2026-04-29 01:23:52 +08:00
parent 209fbec61f
commit 7a2e3f2a06

View File

@@ -34,7 +34,7 @@ class _A2AAliasFinder(MetaPathFinder, Loader):
path: Sequence[str] | None = None,
target: ModuleType | None = None,
) -> ModuleSpec | None:
if fullname == self._SRC or fullname.startswith(self._SRC + "."):
if fullname.startswith(self._SRC + "."):
return ModuleSpec(fullname, self)
return None