Repository navigation
Conversation
fix(cli): await plugin discovery before toolset warning
|
added 2 commits
August 17, 2026 07:42
…iscovery failure - First validation pass now also accepts toolsets from get_plugin_toolset_keys_nowait(), so a toolset whose background discovery already completed no longer forces a redundant synchronous discover_plugins() join and re-validation. - Log discovery failure at warning level so the subsequent Unknown toolsets warning is not mistaken for a genuine unknown-toolset config. - Add regression test: completed background discovery skips the join.
qixuancao
force-pushed
the
fix/plugin-toolset-startup-validation
branch
from
August 16, 2026 23:45
b1ee1c0 to
705558f
Compare
13 of 19 tasks
12 of 13 tasks
This branch has not been deployed
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.
What does this PR do?
Fixes false
Unknown toolsetswarnings when configured plugin toolsets are selected while plugin discovery is still in flight.HermesCLIcould validate a persisted plugin toolset before its plugin finished registering. The normalhermesentry point tracks its background discovery thread, but directcmd_chat/python cli.py -wcan also start discovery through the untrackedtool-prewarmpath. In that path,_discoveredpreviously doubled as both a re-entry guard and a completion signal, allowing validation to observe a half-loaded registry.This change:
PluginManagera single serialized discovery owner and completion condition;Prior work / attribution
This is a current-main follow-up to #25714 by @rewasa. That PR identified the original validation-before-discovery bug and proposed the initial discover-and-revalidate fix. Thank you to @rewasa for the diagnosis and first patch.
#25714 is currently conflicting with
main; this follow-up retains its core fix and adds coverage for the latertool-prewarmconcurrency path, discovery ownership, same-thread re-entry, failure/retry, and startup performance semantics.Related Issue
Follow-up / replacement for #25714. No separate issue exists.
Type of Change
Changes Made
cli.py: wait for completed plugin discovery before declaring configured toolsets unknown.hermes_cli/plugins.py: serialize discovery ownership, concurrent waiting, re-entry, failure, retry, and background-start semantics.hermes_cli/tools_config.py: recognize persisted plugin toolset keys during config validation without forcing startup to block.tests/cli/test_plugin_toolset_startup_validation.py: add deterministic Event-based regressions for tracked and direct-prewarm startup paths.tests/hermes_cli/test_plugins.py: cover concurrent discovery, same-thread re-entry, failure wake/retry, and waiter-cycle behavior.contributors/emails/qixuancao36@gmail.com: map the commit-author email for attribution CI.How to Test
hermes chat -Q --source tool --max-turns 1 -q 'Reply exactly OK without calling tools.'and confirm no falseUnknown toolsetswarning appears.python cli.py -w --quiet --max-turns=1 ...and confirm it also returns without the false warning.Local results on Linux x86_64:
tests/cli: 950 passed, 8 skipped, 0 failed;OK, no false warning;python cli.py -wcanary: exit 0,OK, no false warning;git diff --check: passed.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
cli-config.yaml.examplechanges are N/A; no config keys changedCONTRIBUTING.md/AGENTS.mdchanges are N/A; no workflow changedthreadingprimitives onlyScreenshots / Logs