fix(cli): emit clear warning when toolset belongs to disabled category (#59547) - #59653
Open
SquabbyZ wants to merge 1 commit into
Open
fix(cli): emit clear warning when toolset belongs to disabled category (#59547)#59653SquabbyZ wants to merge 1 commit into
SquabbyZ wants to merge 1 commit into
Conversation
NousResearch#59547) validate_platform_toolsets() in hermes_cli/toolset_validation.py previously emitted a generic 'unknown toolset <name>' warning (sometimes paired with an irrelevant 'hermes-<platform>' typo guess) whenever a toolset name in platform_toolsets wasn't in the live toolset registry. That conflates two distinct failure modes: a real typo vs. a previously-valid plugin toolset whose plugin has since been disabled or uninstalled. Cross-reference known_plugin_toolsets (per-platform snapshot written by _save_platform_tools in hermes_cli/tools_config.py) BEFORE falling back to the generic warning. When a name is found there, emit a distinct message pointing at plugins.enabled and the likely package-uninstall path, and skip the misleading hermes-<platform> guess. The new known_plugin_toolsets parameter is optional and defaults to None, so existing callers and tests aren't affected. The single production call site in hermes_cli/config.py is updated to pass read_raw_config().get('known_plugin_toolsets'), reusing the same try/except-wrapped best-effort validation pass that already runs after every config migration. Tests in tests/cli/test_toolset_validation_warnings.py cover: - known-but-now-missing plugin toolset -> plugin warning, no typo guess - platform-scoped known map (no leakage to other platforms) - genuine typo falls through to the existing generic warning - valid toolset produces no warning (pre-NousResearch#59547 regression guard) - malformed/missing known_plugin_toolsets falls back to pre-NousResearch#59547 output - the zero-valid safety net from NousResearch#38798 still fires when all references on a platform are stale AI-assisted fix by https://github.com/SquabbyZ/peaks-loop
Collaborator
Related: this competes with the open PR #56731 for the same issue #59547 via the same approach (thread |
Contributor
|
Thanks for the focused config-warning fix. The premise remains present on current main: Problems
Suggested changes
This is an automated hermes-sweeper review. |
1 task
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.
Fixes #59547
Summary
When a configured toolset belongs to a plugin that's been disabled or uninstalled, the validator was emitting a misleading 'unknown toolset' warning — often paired with a wrong
hermes-<platform>typo guess that sent users hunting for a misspelling that didn't exist.What changed
hermes_cli/toolset_validation.py::validate_platform_toolsets()now takes an optionalknown_plugin_toolsetsmap. When a toolset name is not in the registered catalog but IS found underknown_plugin_toolsets[platform](written by_save_platform_tools), the validator emits a distinct 'plugin is disabled or uninstalled — re-enable it in plugins.enabled' warning and skips the typo guess.hermes_cli/config.py(post-migration validation pass) viaread_raw_config().get('known_plugin_toolsets'). Defaults toNone, so all 13 existingtests/hermes_cli/test_toolset_validation.pytests still pass with zero regression.How to test
Test plan
tests/cli/test_toolset_validation_warnings.pycovering: disabled-plugin → plugin warning; genuine typo → falls through to generic warning; valid toolset → no warning; platform-scoped known-map isolation; malformedknown_plugin_toolsetsfalls back to pre-fix behavior; zero-valid safety net from bug: config migration (v25->v26) corrupts platform_toolsets, silently kills all tools #38798 still fires.tests/hermes_cli/test_toolset_validation.pytests still pass (no regression).Platforms tested
AI-assisted contribution
This PR was drafted as part of an automated contribution sweep driven by https://github.com/SquabbyZ/peaks-loop. The first attempt was opened against the wrong base repo (the fork instead of NousResearch/hermes-agent) and was closed before this one was opened. All code changes were generated by an AI coding assistant from the issue body — please flag anything that looks off.