From 366fd70f98e42ae4fa2afdb3b05e306b3bddaa55 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 14 Aug 2026 20:51:26 -0700 Subject: [PATCH] fix(gateway): registered_names() honors profile scope like is_registered() The salvaged registered_names() from PR #71582 predates the scoped platform registry: it read only the process-global _entries/_deferred maps, but plugin platforms register their deferred loaders under a profile scope. Result: `hermes tools enable a2a --platform a2a` still rejected the platform. Union the current-scope maps with the global ones, mirroring is_registered()'s semantics, under the registry lock. --- gateway/platform_registry.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gateway/platform_registry.py b/gateway/platform_registry.py index e5554e160e..e639bc838b 100644 --- a/gateway/platform_registry.py +++ b/gateway/platform_registry.py @@ -581,8 +581,22 @@ class PlatformRegistry: return [e for e in self.all_entries() if e.source == "plugin"] def registered_names(self) -> set[str]: - """Return concrete and deferred platform names without loading adapters.""" - return self._entries.keys() | self._deferred.keys() + """Return concrete and deferred platform names without loading adapters. + + Mirrors ``is_registered()``'s scope semantics: names registered under + the current profile scope AND process-global names both count. Plugin + platforms register deferred loaders under a profile scope, so reading + only the global maps would miss every plugin platform. + """ + with self._lock: + scope = self.current_scope_key() + entries, deferred = self._scope_maps(scope) + return ( + entries.keys() + | deferred.keys() + | self._entries.keys() + | self._deferred.keys() + ) def is_registered(self, name: str) -> bool: # A deferred (not-yet-imported) platform still counts as registered --