fix(plugins): register deferred platform client tools at discovery; admit plugin toolsets in config and hermes tools (#81163) - #86660
Merged
Conversation
…78050) Rebased onto current main. `hermes_cli/plugins.py` grew 103KB -> 265KB across 49 commits since the original branch point, and the attribution mechanism this change hooks into was replaced along the way: the `_tools_before` / `_plugin_tool_names` snapshot diff is now a registration ledger sliced from `registration_start`, and `_plugin_id` is `plugin_key`. Re-anchored accordingly: - Discovery-time pre-registration, module reuse, and the `provides_tools` opt-in are unchanged. - Attribution credits `_predeclared_tools` ahead of the ledger slice, since those tools registered before `registration_start` and the slice cannot see them. - A failed materialization no longer carries attribution across. The failure path now sweeps the whole ownership ledger for the plugin key, not just the `registration_start:` slice, so the pre-registered tools are disposed along with the adapter. Attribution and the registry now agree at zero instead of reporting tools the process is not serving. tests/hermes_cli/test_deferred_platform_client_tools.py 13/13. test_plugins.py, test_plugins_cmd_list.py, test_plugin_cli_registration.py 65/65. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…t_platform_tools (#81163) Layer 2 of the #81163 / #78050 fix: _get_platform_tools computed plugin_ts_keys = _get_plugin_toolset_keys() but only used CONFIGURABLE_TOOLSETS in the explicit-config filter, so a user-listed plugin key like `a2a` in `platform_toolsets.cli: [hermes-cli, a2a]` was silently dropped. The filter now unions configurable and plugin toolset keys when evaluating has_explicit_config and when admitting per-key entries. Cherry-picked from PR #81190 (Layer 2 hunks only; Layer 1 is covered by the provides_tools mechanism from PR #78842).
…red() 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.
Contributor
૮ >ﻌ< ა ci reviewran on dcb5241 — fix(gateway): registered_names() honors profile scope like i
|
This was referenced Aug 15, 2026
Closed
Closed
teknium1
added a commit
that referenced
this pull request
Aug 15, 2026
…lugins Follow-up docs for PR #86660 (#81163/#78050): platform-adapter developer guide gains a `provides_tools` section (deferred adapters vs eager client tools, tools.py convention, per-platform enablement incl. plugin platform names as --platform targets); a2a user guide shows the concrete enable commands including the inbound-task chaining case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A2A's five outbound client tools (
a2a_call,a2a_discover,a2a_list,a2a_history,a2a_orchestrate) now work from CLI/TUI sessions, not just gateway processes — and the whole deferred-platform-plugin tool-registration class is fixed by mechanism, closing #81163 and #78050.Root cause:
kind: platformplugins defer their entireregister(ctx)behind a lazy loader that only fires when a gateway/cron/setup path asks the platform_registry for that platform. Client tools rode along on that deferral, sohermes chatsessions never saw them. Two further gates compounded it:_get_platform_toolssilently dropped explicitly-configured plugin toolset keys, andhermes tools --platform a2arejected plugin platform names.Changes
Consolidated salvage of the three-PR cluster, one commit per layer with contributor authorship preserved:
provides_toolsmanifest mechanism from PR fix(plugins): eagerly load platform plugins that declare provides_tools (#78050) #78538 by @Tranquil-Flow): plugins declaringprovides_toolsget theirtools.pyregister_tools(ctx)invoked duringdiscover_plugins(); the heavy adapter stays deferred. Opt-in by manifest, so undeclared platforms are untouched and any future platform plugin with client tools is covered automatically._get_platform_toolsunions plugin toolset keys withCONFIGURABLE_TOOLSETSsoplatform_toolsets.cli: [hermes-cli, a2a]survives filtering.hermes toolsrecognizes plugin platforms (from PR fix(tools): recognize discovered plugin platforms #71582 by @tachyon-r):platform_registry.registered_names()feedshermes tools enable/disable/list --platform <plugin-platform>; plus our follow-up makingregistered_names()honor profile scope likeis_registered()(without it, plugin platforms registered under a profile scope were still invisible).Validation
a2a_*tools in catalog afterdiscover_plugins(); adapter module NOT imported; explicita2akey survives_get_platform_tools; default-off preserved on unconfigured platforms;resolve_toolset("a2a")returns all 5Closes #81163. Fixes #78050. Supersedes #81190, #78842, #78538, #79665, #80630, and the tools_config half of #71582.
Infographic