Update ServicePluginLoader to include modules directory in service path

- Enhanced the ServicePluginLoader to add the modules directory to the path for local services, ensuring that utility modules can be resolved correctly.
- This change improves the loading mechanism for service plugins by allowing better integration of local utilities.
This commit is contained in:
agessaman
2026-03-09 18:07:53 -07:00
parent f908395834
commit 0b58d9fed6
+2 -1
View File
@@ -149,7 +149,8 @@ class ServicePluginLoader:
if "local_services" not in sys.modules:
pkg = types.ModuleType("local_services")
builtin_services_dir = getattr(self, 'services_dir', None) or os.path.join(os.path.dirname(__file__), 'service_plugins')
pkg.__path__ = [str(file_path.parent), builtin_services_dir]
modules_dir = os.path.dirname(__file__) # so local_services.utils resolves to modules.utils
pkg.__path__ = [str(file_path.parent), builtin_services_dir, modules_dir]
sys.modules["local_services"] = pkg
stem = file_path.stem
module_name = f"local_services.{stem}"