Skip to content

fix(plugins): register deferred platform client tools at discovery; admit plugin toolsets in config and hermes tools (#81163) - #86660

Merged
teknium1 merged 5 commits into
mainfrom
fix/81163-deferred-platform-client-tools
Aug 15, 2026
Merged

fix(plugins): register deferred platform client tools at discovery; admit plugin toolsets in config and hermes tools (#81163)#86660
teknium1 merged 5 commits into
mainfrom
fix/81163-deferred-platform-client-tools

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

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: platform plugins defer their entire register(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, so hermes chat sessions never saw them. Two further gates compounded it: _get_platform_tools silently dropped explicitly-configured plugin toolset keys, and hermes tools --platform a2a rejected plugin platform names.

Changes

Consolidated salvage of the three-PR cluster, one commit per layer with contributor authorship preserved:

Validation

Check Result
Targeted suites (plugins, tools_config, deferred client tools, disable/enable, platform_registry, toolsets) 181 passed
E2E (real imports, temp HERMES_HOME, a2a enabled) all 5 a2a_* tools in catalog after discover_plugins(); adapter module NOT imported; explicit a2a key survives _get_platform_tools; default-off preserved on unconfigured platforms; resolve_toolset("a2a") returns all 5
ruff clean
Attribution audit green

Closes #81163. Fixes #78050. Supersedes #81190, #78842, #78538, #79665, #80630, and the tools_config half of #71582.

Infographic

Deferred platform plugin client tools — three-layer fix

thelonewander3r and others added 5 commits August 14, 2026 20:48
…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.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins comp/tools Tool registry, model_tools, toolsets comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles needs-decision Awaiting maintainer decision before any implementation labels Aug 15, 2026
@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on dcb5241 — fix(gateway): registered_names() honors profile scope like i

⚠️ Warnings

CI timings · View report · View job

Wall time 47m12s vs 28m33s (+65.3%). 10 job(s) slower, 13 faster, 1 unchanged.

  • Python tests / Run tests slice 7/12: +47.0s
  • Python tests / Run tests slice 11/12: -41.0s
  • Python tests / Run tests slice 9/12: -34.0s
  • Python tests / Run tests slice 4/12: +31.0s
  • Python tests / Run tests slice 8/12: +16.0s

OSV vulnerability scan · View job

5 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.

@teknium1
teknium1 merged commit 366fd70 into main Aug 15, 2026
86 of 88 checks passed
@teknium1
teknium1 deleted the fix/81163-deferred-platform-client-tools branch August 15, 2026 04:56
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins comp/tools Tool registry, model_tools, toolsets needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

5 participants