fix(plugins): eagerly load platform plugins that declare provides_tools (#78050) - #78538
fix(plugins): eagerly load platform plugins that declare provides_tools (#78050)#78538Tranquil-Flow wants to merge 1 commit into
Conversation
…ls (NousResearch#78050) A platform plugin that also provides outbound agent tools (declared via provides_tools in plugin.yaml) must load eagerly so those tools are visible in CLI/TUI sessions, not only in gateway/web processes where the deferred platform loader fires. Without this, the a2a toolset is in _DEFAULT_OFF_TOOLSETS (opt-in) but the opt-in UI (hermes tools) never shows it because no tools are registered — resolve_toolset('a2a') returns []. Pure inbound adapters (telegram, discord, ...) leave provides_tools empty and stay deferred to avoid importing ~20 heavy platform SDKs on every CLI start.
|
Heads-up @Tranquil-Flow — your That PR was keying discovery-time tool registration off the presence of #79432 was closed today by its author for the same reason, so #78842 now carries all three shapes: your manifest trigger, tools-submodule-only import so the adapter stays deferred, and module-reuse/attribution handling so the package body doesn't execute twice and Genuinely happy to close mine instead if you'd rather drive this one — the module-reuse and attribution pieces are small and I'd hand them over. But if you're content with the field landing there, closing this would leave a single PR in front of maintainers, which is the main thing #78050 needs at this point. One unrelated note while you're here: this PR's body doesn't reference #78050 (only the title does), and GitHub builds cross-links from bodies and comments rather than titles — so it isn't linked from the issue and won't show up for anyone triaging from there. |
What
A2A client tools (
a2a_call,a2a_discover,a2a_list,a2a_history,a2a_orchestrate) are invisible to CLI/TUI sessions — they never appear inhermes tools, cannot be opted into, and are absent from the session toolset.The same tools work correctly in gateway/web/dashboard sessions.
Root cause
The a2a plugin is
kind: platform, and all bundled platform plugins aredeferred by design to avoid importing ~20 heavy platform SDKs on every
hermesinvocation. Deferred plugins are never imported in CLI/TUI processes,so
register()never fires and the five outbound client tools never register.resolve_toolset('a2a')returns[], making the opt-in pathunreachable.
The a2a plugin is unique: it ships both an inbound platform adapter and
five lightweight outbound agent tools (stdlib-only, no SDK dependency). The
deferral was designed for heavy inbound adapters, not lightweight outbound tools.
Fix
Reuse the existing
provides_toolsmanifest field (already used inweb_server.pyandplugins_cmd.py) as the signal for eager loading:plugins/platforms/a2a/plugin.yaml: declareprovides_toolswith thefive tool names.
hermes_cli/plugins.py: a bundled platform plugin with non-emptyprovides_toolseagerly loads via_load_plugin()instead of deferring.Pure inbound adapters leave
provides_toolsempty → stay deferred → noregression.
Only a2a declares
provides_tools; all 21 other platform plugins remaindeferred.
Verification
reverted), the eager-load and toolset-resolution tests fail — plugin is
deferred, tools unregistered,
resolve_toolset('a2a')returns[].failure (
test_path_routed_agent_card_uses_prefix_and_canonical_path—confirmed pre-existing on upstream/main), 1 skipped.
Test coverage
5 new regression tests in
TestA2APluginEagerToolRegistration:resolve_toolset('a2a')resolves to the five toolsAuto-published by Moonsong via Path B automated pipeline.