Skip to content

The agent that grows with you

refactor(gateway): call rearm_failed_platform inline from the reconnect watcher

kshitijk4poore0f12db1bf88
diff --git a/gateway/run_adapters.py b/gateway/run_adapters.py
index 4a9fa1ec3a1..66a53aaaf78 100644
--- a/gateway/run_adapters.py
+++ b/gateway/run_adapters.py
@@ -823,7 +823,8 @@ class GatewayAdapterLifecycleMixin:
self._drop_from_reconnect_queue(platform, "adapter creation returned None")
return
# Unregistered plugin: keep it queued and re-arm a failed load for the next tick.
- self._rearm_failed_platform_load(platform)
+ from hermes_cli.plugins import get_plugin_manager
+ get_plugin_manager().rearm_failed_platform(platform.value)
backoff = self._bump_reconnect_backoff(
platform, info, attempt, "adapter_unavailable", _adapter_unavailable_message(platform),
)
diff --git a/gateway/run_plugin_rewire.py b/gateway/run_plugin_rewire.py
index 69c7b963271..03275d5cd9a 100644
--- a/gateway/run_plugin_rewire.py
+++ b/gateway/run_plugin_rewire.py
@@ -77,12 +77,6 @@ class GatewayPluginRewireMixin:
f" for profile '{profile_name}'" if profile_name else "")
return count
- def _rearm_failed_platform_load(self, platform) -> bool:
- """Reconnect-watcher hook (once per backoff tick): re-arm the current profile's failed platform
- plugin load so the next ``_create_adapter`` retries it instead of waiting for reload-plugins."""
- from hermes_cli.plugins import get_plugin_manager
- return get_plugin_manager().rearm_failed_platform(platform.value)
-
def reload_plugins_verb(runner: Any, loop: asyncio.AbstractEventLoop) -> Callable[..., dict]:
"""Control-socket ``reload-plugins``: force re-discovery under the requested home's scope so a plugin