diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7a49a62203..bae4299b1b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -178,3 +178,9 @@ jobs: - name: Run footgun checker run: python scripts/check-windows-footguns.py --all + + # The Sep 2026 decomposition kept old import paths alive for external plugins + # (PLUGIN-COMPAT blocks, see COMPAT_MANIFEST.md). They are removed on schedule by + # reverting one commit, so in-tree code must never depend on them. + - name: Forbid in-tree use of plugin-compat pointers + run: python scripts/check_compat_pointers.py diff --git a/COMPAT_MANIFEST.md b/COMPAT_MANIFEST.md index 96ff4c2e1c..8782833a42 100644 --- a/COMPAT_MANIFEST.md +++ b/COMPAT_MANIFEST.md @@ -10,6 +10,11 @@ date, by reverting that commit. Update your plugin to import from the `new locat Nothing inside this repository is allowed to use these pointers (`scripts/check_compat_pointers.py` fails CI if it does). +**You will see a warning.** The first time a process resolves a name through one of these blocks, Hermes emits a +`HermesPluginCompatWarning` (a `FutureWarning`) naming the old path, the new path, and the removal target — once per +name per process. Fix the import and it goes away. To silence during migration: +`python -W ignore::hermes_cli.plugin_compat.HermesPluginCompatWarning` or `warnings.filterwarnings("ignore", category=HermesPluginCompatWarning)`. + **Scope.** Only PUBLIC names (no leading underscore) that were defined or imported at module top level before the decomposition are covered. Private names (`_foo`, `_TG_NAME_LIMIT`, `_clamp_telegram_names`, ...) were never part of any surface and are NOT restored; a plugin that patched or imported one must move diff --git a/acp_adapter/server.py b/acp_adapter/server.py index c8dceaf94f..431f7368d8 100644 --- a/acp_adapter/server.py +++ b/acp_adapter/server.py @@ -1005,5 +1005,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/agent_init.py b/agent/agent_init.py index 5039763e36..3421e26df8 100644 --- a/agent/agent_init.py +++ b/agent/agent_init.py @@ -2322,5 +2322,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/anthropic_adapter.py b/agent/anthropic_adapter.py index 9bfd6952c7..7815b1faca 100644 --- a/agent/anthropic_adapter.py +++ b/agent/anthropic_adapter.py @@ -713,5 +713,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/browser_registry.py b/agent/browser_registry.py index 51ae1117d0..038244bfbe 100644 --- a/agent/browser_registry.py +++ b/agent/browser_registry.py @@ -80,5 +80,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/context_compressor.py b/agent/context_compressor.py index a151697c0b..33838ca390 100644 --- a/agent/context_compressor.py +++ b/agent/context_compressor.py @@ -4912,5 +4912,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/conversation_loop.py b/agent/conversation_loop.py index a7776cd5c7..5bd41cc751 100644 --- a/agent/conversation_loop.py +++ b/agent/conversation_loop.py @@ -1594,5 +1594,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/image_gen_registry.py b/agent/image_gen_registry.py index 87d66c5c60..bee2fe2def 100644 --- a/agent/image_gen_registry.py +++ b/agent/image_gen_registry.py @@ -66,5 +66,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/monitoring/cron_health.py b/agent/monitoring/cron_health.py index 8d87e0c6f5..09d0c0a05d 100644 --- a/agent/monitoring/cron_health.py +++ b/agent/monitoring/cron_health.py @@ -187,5 +187,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/nous_rate_guard.py b/agent/nous_rate_guard.py index 3747dcb9ae..2bc4ff6bef 100644 --- a/agent/nous_rate_guard.py +++ b/agent/nous_rate_guard.py @@ -181,5 +181,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/prompt_builder.py b/agent/prompt_builder.py index a328c652e8..d3b4a82941 100644 --- a/agent/prompt_builder.py +++ b/agent/prompt_builder.py @@ -1605,5 +1605,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/secret_sources/_cache.py b/agent/secret_sources/_cache.py index 33cdd826ef..09fb8f0e00 100644 --- a/agent/secret_sources/_cache.py +++ b/agent/secret_sources/_cache.py @@ -205,5 +205,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/secret_sources/bitwarden.py b/agent/secret_sources/bitwarden.py index 118f370765..a8fdf7212e 100644 --- a/agent/secret_sources/bitwarden.py +++ b/agent/secret_sources/bitwarden.py @@ -633,5 +633,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/secret_sources/command.py b/agent/secret_sources/command.py index f2043f5277..da999b1b4e 100644 --- a/agent/secret_sources/command.py +++ b/agent/secret_sources/command.py @@ -377,5 +377,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/secret_sources/onepassword.py b/agent/secret_sources/onepassword.py index 4a10914b37..37369a4031 100644 --- a/agent/secret_sources/onepassword.py +++ b/agent/secret_sources/onepassword.py @@ -354,5 +354,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/system_prompt.py b/agent/system_prompt.py index 125aadaba0..c3e51f0050 100644 --- a/agent/system_prompt.py +++ b/agent/system_prompt.py @@ -727,5 +727,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/terminal_env_registry.py b/agent/terminal_env_registry.py index 4b7b974800..805edf63aa 100644 --- a/agent/terminal_env_registry.py +++ b/agent/terminal_env_registry.py @@ -101,5 +101,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/transcription_provider.py b/agent/transcription_provider.py index a9cf75bc29..ebf517a012 100644 --- a/agent/transcription_provider.py +++ b/agent/transcription_provider.py @@ -54,5 +54,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/transcription_registry.py b/agent/transcription_registry.py index 68abb6e07a..0e5cc06655 100644 --- a/agent/transcription_registry.py +++ b/agent/transcription_registry.py @@ -65,5 +65,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/tts_registry.py b/agent/tts_registry.py index 4a785e5f6f..656ccab865 100644 --- a/agent/tts_registry.py +++ b/agent/tts_registry.py @@ -65,5 +65,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/turn_context.py b/agent/turn_context.py index 52d053ec88..82bba061a8 100644 --- a/agent/turn_context.py +++ b/agent/turn_context.py @@ -1023,5 +1023,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/video_gen_registry.py b/agent/video_gen_registry.py index 935aa69f61..b326a075fb 100644 --- a/agent/video_gen_registry.py +++ b/agent/video_gen_registry.py @@ -65,5 +65,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/agent/web_search_registry.py b/agent/web_search_registry.py index df1643193b..fcb0c44099 100644 --- a/agent/web_search_registry.py +++ b/agent/web_search_registry.py @@ -220,5 +220,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/cli.py b/cli.py index 2d79f53d0e..cbe2e9976f 100644 --- a/cli.py +++ b/cli.py @@ -4646,5 +4646,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/cron/scheduler.py b/cron/scheduler.py index b2db71db52..78b57f5253 100644 --- a/cron/scheduler.py +++ b/cron/scheduler.py @@ -3889,5 +3889,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/gateway/disk_status.py b/gateway/disk_status.py index a5cda3a7f8..d2ed996788 100644 --- a/gateway/disk_status.py +++ b/gateway/disk_status.py @@ -77,5 +77,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/gateway/hosted_room_replicas.py b/gateway/hosted_room_replicas.py index 384fcf03be..505404179c 100644 --- a/gateway/hosted_room_replicas.py +++ b/gateway/hosted_room_replicas.py @@ -305,5 +305,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/gateway/kanban_watchers.py b/gateway/kanban_watchers.py index 1aa3d2ac3d..c637086db4 100644 --- a/gateway/kanban_watchers.py +++ b/gateway/kanban_watchers.py @@ -327,5 +327,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/gateway/memory_status.py b/gateway/memory_status.py index f600286113..223069d7bf 100644 --- a/gateway/memory_status.py +++ b/gateway/memory_status.py @@ -129,5 +129,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/gateway/platforms/qqbot/keyboards.py b/gateway/platforms/qqbot/keyboards.py index 9d31e2b517..76f1ca25cb 100644 --- a/gateway/platforms/qqbot/keyboards.py +++ b/gateway/platforms/qqbot/keyboards.py @@ -281,5 +281,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/gateway/platforms/signal.py b/gateway/platforms/signal.py index 254de671b7..f73c39045e 100644 --- a/gateway/platforms/signal.py +++ b/gateway/platforms/signal.py @@ -994,5 +994,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/gateway/platforms/yuanbao_proto.py b/gateway/platforms/yuanbao_proto.py index cb138c1e4b..d9486ac969 100644 --- a/gateway/platforms/yuanbao_proto.py +++ b/gateway/platforms/yuanbao_proto.py @@ -612,5 +612,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/gateway/run.py b/gateway/run.py index c3a2d89b04..f59ae79a82 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -5506,5 +5506,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/gateway/session.py b/gateway/session.py index 72a7c8e88f..e07f49a11b 100644 --- a/gateway/session.py +++ b/gateway/session.py @@ -1216,5 +1216,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/gateway/slash_commands.py b/gateway/slash_commands.py index 32121ca61f..bc7aaabb66 100644 --- a/gateway/slash_commands.py +++ b/gateway/slash_commands.py @@ -1269,5 +1269,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/gateway/stream_consumer.py b/gateway/stream_consumer.py index 6d06275376..24befeb43a 100644 --- a/gateway/stream_consumer.py +++ b/gateway/stream_consumer.py @@ -954,5 +954,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/gateway/stream_dispatch.py b/gateway/stream_dispatch.py index fad35e71b0..45b2b81b2d 100644 --- a/gateway/stream_dispatch.py +++ b/gateway/stream_dispatch.py @@ -100,5 +100,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/auth.py b/hermes_cli/auth.py index e8c711a219..9983ae6141 100644 --- a/hermes_cli/auth.py +++ b/hermes_cli/auth.py @@ -2229,5 +2229,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/checkpoints.py b/hermes_cli/checkpoints.py index 403a130ed0..48decf0a86 100644 --- a/hermes_cli/checkpoints.py +++ b/hermes_cli/checkpoints.py @@ -234,5 +234,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/commands.py b/hermes_cli/commands.py index 8dfa0f3716..838aa5a109 100644 --- a/hermes_cli/commands.py +++ b/hermes_cli/commands.py @@ -720,5 +720,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/config.py b/hermes_cli/config.py index 21c780b9ea..e9a8176796 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -3905,5 +3905,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/dashboard_auth/middleware.py b/hermes_cli/dashboard_auth/middleware.py index a48a36008a..80c7bcc8a1 100644 --- a/hermes_cli/dashboard_auth/middleware.py +++ b/hermes_cli/dashboard_auth/middleware.py @@ -243,5 +243,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/dingtalk_auth.py b/hermes_cli/dingtalk_auth.py index 0de0a58c71..9874b0be12 100644 --- a/hermes_cli/dingtalk_auth.py +++ b/hermes_cli/dingtalk_auth.py @@ -198,5 +198,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/doctor.py b/hermes_cli/doctor.py index ffc61b13f0..f79aff5c4d 100644 --- a/hermes_cli/doctor.py +++ b/hermes_cli/doctor.py @@ -228,5 +228,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/gateway.py b/hermes_cli/gateway.py index a098154ff3..ab81b1a50b 100644 --- a/hermes_cli/gateway.py +++ b/hermes_cli/gateway.py @@ -6190,5 +6190,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/kanban_db.py b/hermes_cli/kanban_db.py index f718545c91..47fdffc353 100644 --- a/hermes_cli/kanban_db.py +++ b/hermes_cli/kanban_db.py @@ -4276,5 +4276,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/local_runtime/binaries.py b/hermes_cli/local_runtime/binaries.py index 3ee4ef9f13..f7a4714fdb 100644 --- a/hermes_cli/local_runtime/binaries.py +++ b/hermes_cli/local_runtime/binaries.py @@ -317,5 +317,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/local_runtime/bootstrap.py b/hermes_cli/local_runtime/bootstrap.py index 280fdcbfa4..792f2acd90 100644 --- a/hermes_cli/local_runtime/bootstrap.py +++ b/hermes_cli/local_runtime/bootstrap.py @@ -299,5 +299,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/main.py b/hermes_cli/main.py index 813b5235fc..6cb431dae7 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -3427,5 +3427,7 @@ def __getattr__(name): # PEP 562 — chained onto the module's own __getattr__ if target is None: return _plugin_compat_prev_getattr(name) import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/mcp_picker.py b/hermes_cli/mcp_picker.py index 24619a3d82..aa80163a5e 100644 --- a/hermes_cli/mcp_picker.py +++ b/hermes_cli/mcp_picker.py @@ -236,5 +236,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/model_setup_flows.py b/hermes_cli/model_setup_flows.py index d046cd41a8..0f1b5acb34 100644 --- a/hermes_cli/model_setup_flows.py +++ b/hermes_cli/model_setup_flows.py @@ -1071,5 +1071,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/model_switch.py b/hermes_cli/model_switch.py index 02f2939a13..be1a095418 100644 --- a/hermes_cli/model_switch.py +++ b/hermes_cli/model_switch.py @@ -1518,5 +1518,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/models.py b/hermes_cli/models.py index c43a4758b7..50e513b65a 100644 --- a/hermes_cli/models.py +++ b/hermes_cli/models.py @@ -2468,5 +2468,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/nous_subscription.py b/hermes_cli/nous_subscription.py index bff6b08d3c..5f7fb37013 100644 --- a/hermes_cli/nous_subscription.py +++ b/hermes_cli/nous_subscription.py @@ -741,5 +741,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/observability/relay_shared_metrics.py b/hermes_cli/observability/relay_shared_metrics.py index e496659a4a..61cfe68508 100644 --- a/hermes_cli/observability/relay_shared_metrics.py +++ b/hermes_cli/observability/relay_shared_metrics.py @@ -1085,5 +1085,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/onepassword_secrets_cli.py b/hermes_cli/onepassword_secrets_cli.py index 6accb552f3..07322472c0 100644 --- a/hermes_cli/onepassword_secrets_cli.py +++ b/hermes_cli/onepassword_secrets_cli.py @@ -413,5 +413,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/plugin_compat.py b/hermes_cli/plugin_compat.py new file mode 100644 index 0000000000..d2fb3a301c --- /dev/null +++ b/hermes_cli/plugin_compat.py @@ -0,0 +1,38 @@ +"""Once-per-process notice for external plugins still importing from pre-decomposition module paths. + +The Sep 2026 decomposition (PR #102117) moved most of Hermes's internals into ``_`` sibling +modules. Old paths keep resolving through ``PLUGIN-COMPAT`` blocks so plugins have time to update; each +resolution through such a block calls :func:`warn_once` so the plugin author sees, exactly once per process +per name, where the code went and when the old path disappears. Internal Hermes code never reaches this +(``scripts/check_compat_pointers.py`` fails CI if it does). + +This module is part of the compat layer and is removed with it. +""" +from __future__ import annotations + +import os +import warnings + +# Set by the maintainers when the removal is scheduled; surfaces in every warning and in COMPAT_MANIFEST.md. +COMPAT_REMOVAL = os.environ.get("HERMES_PLUGIN_COMPAT_REMOVAL", "the next minor release after the announced date (see COMPAT_MANIFEST.md)") + + +class HermesPluginCompatWarning(FutureWarning): + """A plugin imported a name from its pre-decomposition module path.""" + + +_seen: set[tuple[str, str]] = set() + + +def warn_once(facade: str, name: str, target_module: str, target_name: str) -> None: + key = (facade, name) + if key in _seen: + return + _seen.add(key) + new = f"{target_module}.{target_name}" if target_name != name else f"{target_module}.{name}" + warnings.warn( + f"hermes plugin compat: `{facade}.{name}` moved to `{new}`. The old path is kept only for external " + f"plugins and is removed in {COMPAT_REMOVAL}; update your import.", + HermesPluginCompatWarning, + stacklevel=3, + ) diff --git a/hermes_cli/plugins.py b/hermes_cli/plugins.py index cef22a5b4a..d9840a7e72 100644 --- a/hermes_cli/plugins.py +++ b/hermes_cli/plugins.py @@ -2096,5 +2096,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/profile_distribution.py b/hermes_cli/profile_distribution.py index 984aea9fd3..82f7fa3fc2 100644 --- a/hermes_cli/profile_distribution.py +++ b/hermes_cli/profile_distribution.py @@ -476,5 +476,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/runtime_provider.py b/hermes_cli/runtime_provider.py index 6d62983e8e..db1d8dc8bc 100644 --- a/hermes_cli/runtime_provider.py +++ b/hermes_cli/runtime_provider.py @@ -887,5 +887,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/setup.py b/hermes_cli/setup.py index f5c0c98e74..0feb31f3b5 100644 --- a/hermes_cli/setup.py +++ b/hermes_cli/setup.py @@ -807,5 +807,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/status.py b/hermes_cli/status.py index 7d6965e3a9..8d1536b186 100644 --- a/hermes_cli/status.py +++ b/hermes_cli/status.py @@ -378,5 +378,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/tools_config.py b/hermes_cli/tools_config.py index 8c2ab10d99..e10af182e7 100644 --- a/hermes_cli/tools_config.py +++ b/hermes_cli/tools_config.py @@ -1082,5 +1082,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/web_routers/skills.py b/hermes_cli/web_routers/skills.py index 9c78a1b956..0302fd8ad7 100644 --- a/hermes_cli/web_routers/skills.py +++ b/hermes_cli/web_routers/skills.py @@ -455,5 +455,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/web_routers/tools.py b/hermes_cli/web_routers/tools.py index 6340b3da01..c6bf5046a4 100644 --- a/hermes_cli/web_routers/tools.py +++ b/hermes_cli/web_routers/tools.py @@ -702,5 +702,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/web_server.py b/hermes_cli/web_server.py index 216746302e..1ffe8c6d28 100644 --- a/hermes_cli/web_server.py +++ b/hermes_cli/web_server.py @@ -1823,5 +1823,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_cli/webhook.py b/hermes_cli/webhook.py index fb7c1983e2..3a27280fdd 100644 --- a/hermes_cli/webhook.py +++ b/hermes_cli/webhook.py @@ -244,5 +244,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/hermes_state.py b/hermes_state.py index 2bb6c8667f..bdbd93c3de 100644 --- a/hermes_state.py +++ b/hermes_state.py @@ -1364,5 +1364,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/browser/browser_use/provider.py b/plugins/browser/browser_use/provider.py index 9cbc21d17d..138f16198d 100644 --- a/plugins/browser/browser_use/provider.py +++ b/plugins/browser/browser_use/provider.py @@ -177,5 +177,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/browser/browserbase/provider.py b/plugins/browser/browserbase/provider.py index 264e3a5ade..9c1dc982db 100644 --- a/plugins/browser/browserbase/provider.py +++ b/plugins/browser/browserbase/provider.py @@ -133,5 +133,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/browser/firecrawl/provider.py b/plugins/browser/firecrawl/provider.py index f608842937..d8f1ee4398 100644 --- a/plugins/browser/firecrawl/provider.py +++ b/plugins/browser/firecrawl/provider.py @@ -86,5 +86,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/dashboard_auth/basic/__init__.py b/plugins/dashboard_auth/basic/__init__.py index 749f7f2dcd..287f0cd303 100644 --- a/plugins/dashboard_auth/basic/__init__.py +++ b/plugins/dashboard_auth/basic/__init__.py @@ -280,5 +280,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/dashboard_auth/drain/__init__.py b/plugins/dashboard_auth/drain/__init__.py index de645211d1..7de4f62db8 100644 --- a/plugins/dashboard_auth/drain/__init__.py +++ b/plugins/dashboard_auth/drain/__init__.py @@ -173,5 +173,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/dashboard_auth/nous/__init__.py b/plugins/dashboard_auth/nous/__init__.py index 3eb7731408..b0557b8027 100644 --- a/plugins/dashboard_auth/nous/__init__.py +++ b/plugins/dashboard_auth/nous/__init__.py @@ -180,5 +180,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/dashboard_auth/self_hosted/__init__.py b/plugins/dashboard_auth/self_hosted/__init__.py index 09fc38f22c..75e2542221 100644 --- a/plugins/dashboard_auth/self_hosted/__init__.py +++ b/plugins/dashboard_auth/self_hosted/__init__.py @@ -317,5 +317,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/image_gen/deepinfra/__init__.py b/plugins/image_gen/deepinfra/__init__.py index df90c313e9..df9091e96a 100644 --- a/plugins/image_gen/deepinfra/__init__.py +++ b/plugins/image_gen/deepinfra/__init__.py @@ -174,5 +174,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/image_gen/fal/__init__.py b/plugins/image_gen/fal/__init__.py index b5d3cfc389..1d7be724ee 100644 --- a/plugins/image_gen/fal/__init__.py +++ b/plugins/image_gen/fal/__init__.py @@ -130,5 +130,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/image_gen/krea/__init__.py b/plugins/image_gen/krea/__init__.py index ff36f004dc..52bbf4d61e 100644 --- a/plugins/image_gen/krea/__init__.py +++ b/plugins/image_gen/krea/__init__.py @@ -538,5 +538,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/image_gen/openai/__init__.py b/plugins/image_gen/openai/__init__.py index e5b5e3baa0..d54f109cfe 100644 --- a/plugins/image_gen/openai/__init__.py +++ b/plugins/image_gen/openai/__init__.py @@ -163,5 +163,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/image_gen/xai/__init__.py b/plugins/image_gen/xai/__init__.py index ca27cf7585..1bcd7b18a6 100644 --- a/plugins/image_gen/xai/__init__.py +++ b/plugins/image_gen/xai/__init__.py @@ -339,5 +339,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/memory/honcho/__init__.py b/plugins/memory/honcho/__init__.py index 309fde2562..badceff6e0 100644 --- a/plugins/memory/honcho/__init__.py +++ b/plugins/memory/honcho/__init__.py @@ -1014,5 +1014,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/memory/honcho/client.py b/plugins/memory/honcho/client.py index 55bc707c3e..ba352d09c3 100644 --- a/plugins/memory/honcho/client.py +++ b/plugins/memory/honcho/client.py @@ -611,5 +611,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/platforms/dingtalk/adapter.py b/plugins/platforms/dingtalk/adapter.py index f0ea6abf62..46049d0211 100644 --- a/plugins/platforms/dingtalk/adapter.py +++ b/plugins/platforms/dingtalk/adapter.py @@ -773,5 +773,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/platforms/discord/adapter.py b/plugins/platforms/discord/adapter.py index a1281e22af..f97bfae474 100644 --- a/plugins/platforms/discord/adapter.py +++ b/plugins/platforms/discord/adapter.py @@ -7370,5 +7370,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/platforms/google_chat/oauth.py b/plugins/platforms/google_chat/oauth.py index 1be1399a22..e176354d5e 100644 --- a/plugins/platforms/google_chat/oauth.py +++ b/plugins/platforms/google_chat/oauth.py @@ -465,5 +465,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/platforms/photon/adapter.py b/plugins/platforms/photon/adapter.py index faf344c4f7..64e7553fcb 100644 --- a/plugins/platforms/photon/adapter.py +++ b/plugins/platforms/photon/adapter.py @@ -1633,5 +1633,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/platforms/photon/cli.py b/plugins/platforms/photon/cli.py index 9f78b80650..07a5e36086 100644 --- a/plugins/platforms/photon/cli.py +++ b/plugins/platforms/photon/cli.py @@ -362,5 +362,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/platforms/teams/adapter.py b/plugins/platforms/teams/adapter.py index 7dc0f728b8..a596f1142b 100644 --- a/plugins/platforms/teams/adapter.py +++ b/plugins/platforms/teams/adapter.py @@ -821,5 +821,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/platforms/telegram/adapter.py b/plugins/platforms/telegram/adapter.py index c6406ae721..73afb13b0f 100644 --- a/plugins/platforms/telegram/adapter.py +++ b/plugins/platforms/telegram/adapter.py @@ -6519,5 +6519,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/platforms/wecom/adapter.py b/plugins/platforms/wecom/adapter.py index 289f41dfa8..383d42aa60 100644 --- a/plugins/platforms/wecom/adapter.py +++ b/plugins/platforms/wecom/adapter.py @@ -932,5 +932,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/spotify/__init__.py b/plugins/spotify/__init__.py index cd01225088..55921c8028 100644 --- a/plugins/spotify/__init__.py +++ b/plugins/spotify/__init__.py @@ -53,5 +53,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/spotify/tools.py b/plugins/spotify/tools.py index af803b3093..18c913842a 100644 --- a/plugins/spotify/tools.py +++ b/plugins/spotify/tools.py @@ -333,5 +333,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/teams_pipeline/cli.py b/plugins/teams_pipeline/cli.py index b45c20e763..3f56d3006f 100644 --- a/plugins/teams_pipeline/cli.py +++ b/plugins/teams_pipeline/cli.py @@ -336,5 +336,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/teams_pipeline/subscriptions.py b/plugins/teams_pipeline/subscriptions.py index 745acda3f8..ddb6769745 100644 --- a/plugins/teams_pipeline/subscriptions.py +++ b/plugins/teams_pipeline/subscriptions.py @@ -145,5 +145,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/web/brave_free/provider.py b/plugins/web/brave_free/provider.py index f03488951f..98a1872bc8 100644 --- a/plugins/web/brave_free/provider.py +++ b/plugins/web/brave_free/provider.py @@ -65,5 +65,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/web/ddgs/provider.py b/plugins/web/ddgs/provider.py index 68acbb3add..2fa338ec70 100644 --- a/plugins/web/ddgs/provider.py +++ b/plugins/web/ddgs/provider.py @@ -235,5 +235,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/web/exa/provider.py b/plugins/web/exa/provider.py index f4340fff72..f6d4dc753b 100644 --- a/plugins/web/exa/provider.py +++ b/plugins/web/exa/provider.py @@ -86,5 +86,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/web/firecrawl/provider.py b/plugins/web/firecrawl/provider.py index 1f338ec740..b1d911f798 100644 --- a/plugins/web/firecrawl/provider.py +++ b/plugins/web/firecrawl/provider.py @@ -343,5 +343,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/web/keenable/provider.py b/plugins/web/keenable/provider.py index 324d1f873a..111b9aaaa0 100644 --- a/plugins/web/keenable/provider.py +++ b/plugins/web/keenable/provider.py @@ -102,5 +102,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/web/parallel/provider.py b/plugins/web/parallel/provider.py index 2be0b0f83c..dbb4585694 100644 --- a/plugins/web/parallel/provider.py +++ b/plugins/web/parallel/provider.py @@ -104,5 +104,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/web/searxng/provider.py b/plugins/web/searxng/provider.py index 187e8598b3..91c8b012af 100644 --- a/plugins/web/searxng/provider.py +++ b/plugins/web/searxng/provider.py @@ -62,5 +62,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/web/tavily/provider.py b/plugins/web/tavily/provider.py index 6e689b450b..b1667ea1ec 100644 --- a/plugins/web/tavily/provider.py +++ b/plugins/web/tavily/provider.py @@ -140,5 +140,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/plugins/web/xai/provider.py b/plugins/web/xai/provider.py index 30f68bb381..693a8e8814 100644 --- a/plugins/web/xai/provider.py +++ b/plugins/web/xai/provider.py @@ -276,5 +276,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/providers/__init__.py b/providers/__init__.py index c198273e9b..baa3774a5c 100644 --- a/providers/__init__.py +++ b/providers/__init__.py @@ -430,5 +430,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/run_agent.py b/run_agent.py index a3db668990..fc1fe0711e 100644 --- a/run_agent.py +++ b/run_agent.py @@ -1549,5 +1549,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tests/test_compat_manifest_targets.py b/tests/test_compat_manifest_targets.py index e72396f457..461636586e 100644 --- a/tests/test_compat_manifest_targets.py +++ b/tests/test_compat_manifest_targets.py @@ -19,7 +19,11 @@ import pytest ROOT = Path(__file__).resolve().parent.parent MANIFEST = ROOT / "compat_manifest.json" -pytestmark = pytest.mark.skipif(not MANIFEST.exists(), reason="compat layer removed (scheduled revert)") +# This file resolves every pointer on purpose; the once-per-name plugin warning is expected here. +pytestmark = [ + pytest.mark.skipif(not MANIFEST.exists(), reason="compat layer removed (scheduled revert)"), + pytest.mark.filterwarnings("ignore::FutureWarning"), +] def _entries(): diff --git a/tests/test_plugin_compat_warning.py b/tests/test_plugin_compat_warning.py new file mode 100644 index 0000000000..ed8e6c2443 --- /dev/null +++ b/tests/test_plugin_compat_warning.py @@ -0,0 +1,46 @@ +"""The plugin-compat layer tells plugin authors where a name went, once, and internal code never trips it. + +Kept alongside the compat layer (tests/test_compat_manifest_targets.py); both are deleted with it. +""" +import importlib +import json +import warnings +from pathlib import Path + +import pytest + +ROOT = Path(__file__).resolve().parent.parent +MANIFEST = ROOT / "compat_manifest.json" +pytestmark = pytest.mark.skipif(not MANIFEST.exists(), reason="compat layer removed (scheduled revert)") + + +def _a_lazy_entry(): + entries = json.loads(MANIFEST.read_text())["entries"] + e = next(x for x in entries if x["kind"] == "moved-lazy" and x["facade"] == "tools.web_tools") + return e["facade"], e["name"] + + +def test_compat_resolution_warns_once_per_name_with_the_new_location(): + from hermes_cli.plugin_compat import HermesPluginCompatWarning, _seen + facade, name = _a_lazy_entry() + _seen.discard((facade, name)) + mod = importlib.import_module(facade) + with warnings.catch_warnings(record=True) as rec: + warnings.simplefilter("always") + getattr(mod, name) + getattr(mod, name) + ours = [w for w in rec if issubclass(w.category, HermesPluginCompatWarning)] + assert len(ours) == 1, [str(w.message) for w in rec] + msg = str(ours[0].message) + assert f"`{facade}.{name}` moved to `" in msg and "removed in" in msg + + +def test_importing_the_facade_itself_does_not_warn(): + """Only RESOLVING a compat name warns; plugins that import the module for its live API stay silent.""" + from hermes_cli.plugin_compat import HermesPluginCompatWarning + import sys + sys.modules.pop("tools.web_tools", None) + with warnings.catch_warnings(record=True) as rec: + warnings.simplefilter("always") + importlib.import_module("tools.web_tools") + assert not [w for w in rec if issubclass(w.category, HermesPluginCompatWarning)] diff --git a/tools/approval.py b/tools/approval.py index 9e1570caa4..646925346f 100644 --- a/tools/approval.py +++ b/tools/approval.py @@ -1155,5 +1155,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/browser_dialog_tool.py b/tools/browser_dialog_tool.py index 07873f71d3..49194abf64 100644 --- a/tools/browser_dialog_tool.py +++ b/tools/browser_dialog_tool.py @@ -126,5 +126,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/browser_supervisor.py b/tools/browser_supervisor.py index 9a612cf319..2a7903aa29 100644 --- a/tools/browser_supervisor.py +++ b/tools/browser_supervisor.py @@ -507,5 +507,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/browser_tool.py b/tools/browser_tool.py index 41a047ffc1..63e8bec2c0 100644 --- a/tools/browser_tool.py +++ b/tools/browser_tool.py @@ -1359,5 +1359,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/close_preview_tool.py b/tools/close_preview_tool.py index 12095c9231..d04c5a3b4d 100644 --- a/tools/close_preview_tool.py +++ b/tools/close_preview_tool.py @@ -58,5 +58,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/code_execution_tool.py b/tools/code_execution_tool.py index 1896fe2ab1..bf56c3e7c2 100644 --- a/tools/code_execution_tool.py +++ b/tools/code_execution_tool.py @@ -927,5 +927,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/computer_use/__init__.py b/tools/computer_use/__init__.py index 9fa01d3039..cc0e9ee96b 100644 --- a/tools/computer_use/__init__.py +++ b/tools/computer_use/__init__.py @@ -33,5 +33,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/computer_use/cua_backend.py b/tools/computer_use/cua_backend.py index 109575b141..9be4b19cb7 100644 --- a/tools/computer_use/cua_backend.py +++ b/tools/computer_use/cua_backend.py @@ -407,5 +407,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/cronjob_tools.py b/tools/cronjob_tools.py index a728873945..48aaa00d9d 100644 --- a/tools/cronjob_tools.py +++ b/tools/cronjob_tools.py @@ -1045,5 +1045,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/delegate_tool.py b/tools/delegate_tool.py index 9eb979ded6..70e98fe6a6 100644 --- a/tools/delegate_tool.py +++ b/tools/delegate_tool.py @@ -644,5 +644,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/environments/base.py b/tools/environments/base.py index 014bfd1131..52650a973e 100644 --- a/tools/environments/base.py +++ b/tools/environments/base.py @@ -548,5 +548,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/feishu_doc_tool.py b/tools/feishu_doc_tool.py index 958ecb3874..0fca3f0d9a 100644 --- a/tools/feishu_doc_tool.py +++ b/tools/feishu_doc_tool.py @@ -89,5 +89,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/file_operations.py b/tools/file_operations.py index 3fb02295c4..5044145bb2 100644 --- a/tools/file_operations.py +++ b/tools/file_operations.py @@ -1420,5 +1420,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/file_tools.py b/tools/file_tools.py index 6264044c8b..280f896fcc 100644 --- a/tools/file_tools.py +++ b/tools/file_tools.py @@ -1247,5 +1247,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/mcp_tool.py b/tools/mcp_tool.py index a67cc5a449..f4fb25884f 100644 --- a/tools/mcp_tool.py +++ b/tools/mcp_tool.py @@ -672,5 +672,7 @@ def __getattr__(name): # PEP 562 — chained onto the module's own __getattr__ if target is None: return _plugin_compat_prev_getattr(name) import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/memory_tool.py b/tools/memory_tool.py index 79a56efcb6..8028ffd88a 100644 --- a/tools/memory_tool.py +++ b/tools/memory_tool.py @@ -344,5 +344,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/microsoft_graph_client.py b/tools/microsoft_graph_client.py index 6a7921097b..018d1a88ec 100644 --- a/tools/microsoft_graph_client.py +++ b/tools/microsoft_graph_client.py @@ -199,5 +199,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/open_preview_tool.py b/tools/open_preview_tool.py index 7c0b9b760c..d40f53a34a 100644 --- a/tools/open_preview_tool.py +++ b/tools/open_preview_tool.py @@ -91,5 +91,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/path_security.py b/tools/path_security.py index 8fee6dd694..b58232df2f 100644 --- a/tools/path_security.py +++ b/tools/path_security.py @@ -35,5 +35,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/react_to_message_tool.py b/tools/react_to_message_tool.py index d4c21d638c..2850d0188c 100644 --- a/tools/react_to_message_tool.py +++ b/tools/react_to_message_tool.py @@ -134,5 +134,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/read_preview_tool.py b/tools/read_preview_tool.py index 1a491d1325..7e1334d8e8 100644 --- a/tools/read_preview_tool.py +++ b/tools/read_preview_tool.py @@ -70,5 +70,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/read_window_tool.py b/tools/read_window_tool.py index cae4f8cf95..267ff6ad6f 100644 --- a/tools/read_window_tool.py +++ b/tools/read_window_tool.py @@ -65,5 +65,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/send_message_tool.py b/tools/send_message_tool.py index f62e773a7c..28eec9706a 100644 --- a/tools/send_message_tool.py +++ b/tools/send_message_tool.py @@ -584,5 +584,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/skill_manager_tool.py b/tools/skill_manager_tool.py index 70cffd3942..d090222b6e 100644 --- a/tools/skill_manager_tool.py +++ b/tools/skill_manager_tool.py @@ -893,5 +893,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/skills_hub.py b/tools/skills_hub.py index 65e8927a15..7de6260374 100644 --- a/tools/skills_hub.py +++ b/tools/skills_hub.py @@ -383,5 +383,7 @@ def __getattr__(name): # PEP 562 — chained onto the module's own __getattr__ if target is None: return _plugin_compat_prev_getattr(name) import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/skills_sync.py b/tools/skills_sync.py index 08861d6f87..322167e5ad 100644 --- a/tools/skills_sync.py +++ b/tools/skills_sync.py @@ -465,5 +465,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/skills_sync_client.py b/tools/skills_sync_client.py index d5a2ec291e..abd6399b6d 100644 --- a/tools/skills_sync_client.py +++ b/tools/skills_sync_client.py @@ -562,5 +562,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/skills_tool.py b/tools/skills_tool.py index 0e9563793b..ed7b318df1 100644 --- a/tools/skills_tool.py +++ b/tools/skills_tool.py @@ -685,5 +685,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/terminal_tool.py b/tools/terminal_tool.py index ed10535e5d..c5e8419822 100644 --- a/tools/terminal_tool.py +++ b/tools/terminal_tool.py @@ -1332,5 +1332,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/transcription_tools.py b/tools/transcription_tools.py index 4ccac30161..5704032bae 100644 --- a/tools/transcription_tools.py +++ b/tools/transcription_tools.py @@ -596,5 +596,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/tts_tool.py b/tools/tts_tool.py index 6cf486826a..50ac84b398 100644 --- a/tools/tts_tool.py +++ b/tools/tts_tool.py @@ -676,5 +676,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/voice_mode.py b/tools/voice_mode.py index 05014bd7a1..89c7d5118c 100644 --- a/tools/voice_mode.py +++ b/tools/voice_mode.py @@ -1566,5 +1566,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tools/web_tools.py b/tools/web_tools.py index 2895fffe9b..56d1b9045e 100644 --- a/tools/web_tools.py +++ b/tools/web_tools.py @@ -539,5 +539,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tui_gateway/compute_host.py b/tui_gateway/compute_host.py index eec7ec24fc..48256fc709 100644 --- a/tui_gateway/compute_host.py +++ b/tui_gateway/compute_host.py @@ -594,5 +594,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ---- diff --git a/tui_gateway/methods_browser_control.py b/tui_gateway/methods_browser_control.py index e1a12bdc14..b3563733fd 100644 --- a/tui_gateway/methods_browser_control.py +++ b/tui_gateway/methods_browser_control.py @@ -224,5 +224,7 @@ def __getattr__(name): # PEP 562 — lazy so no import cycles if target is None: raise AttributeError(f"module {__name__!r} has no attribute {name!r}") import importlib + from hermes_cli.plugin_compat import warn_once + warn_once(__name__, name, *target) return getattr(importlib.import_module(target[0]), target[1]) # ---- END PLUGIN-COMPAT ----