Skip to content

The agent that grows with you

fix(providers): bundled_profiles loads no plugin code in a safe worker

Ben Barclay9d1cf25f00df
diff --git a/providers/__init__.py b/providers/__init__.py
index f824ed0d64e..34e4139d6c9 100644
--- a/providers/__init__.py
+++ b/providers/__init__.py
@@ -831,6 +831,10 @@ def bundled_profiles() -> list[ProviderProfile]:
order), WITHOUT config and without touching the registry: each bundled plugin is executed into
a private module whose registrations are collected. For descriptive catalogs, which must not
depend on config or on discovery having run."""
+ from agent.safe_worker_policy import safe_worker_enabled
+
+ if safe_worker_enabled(): # a safe worker loads no plugin code, bundled included (as list_providers)
+ return []
collected: list[ProviderProfile] = []
token = _COLLECT.set(collected)
try: