fix(skills-config): normalize scalar/None disabled-skill entries (salvage of #14094 by @LeonSGP43) - #52895
Closed
Bartok9 wants to merge 1 commit into
Closed
Conversation
Salvage of NousResearch#14094 by @LeonSGP43 — rebased onto current main (preserving its global|platform union semantics) with regression tests that fail without it.
1 task
Contributor
|
Closing — the normalization landed on main via PR #61797 with the same shape as this salvage (and #52895's tests were mirrored there). Credit chain for this fix: @zhanggttry's #13078 (April) was the earliest, then @LeonSGP43's #14094, then this salvage. Thanks for pushing it forward! |
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
Salvage of #14094 by @LeonSGP43 — rebased onto current
origin/main(preserving main's global|platform union semantics) with regression tests.get_disabled_skillsdoesset(skills_cfg.get("disabled", [])). A scalardisabled: my-skillbecomes a set of its characters, andskills: nullraisesAttributeErroron.get().Root Cause
Symptom — Two config-shape footguns: (1)
disabled: my-skill(a common single-skill mistake) silently disables skills namedm,y,-,s, … instead ofmy-skill; (2)skills: null(valid YAML) crashes skill-disable resolution withAttributeError.Root cause — In
get_disabled_skills(hermes_cli/skills_config.py),skills_cfg = config.get("skills", {})can beNone(→.getAttributeError), andset(scalar_string)iterates the string into characters. Same forplatform_disabledvalues.Evidence — The added tests cover scalar
disabled,skills: null, and scalarplatform_disabled; all three fail without the fix (char-set / AttributeError).Fix + why this level — Add
_normalize_string_set()(None→empty, scalar→single-element, list→trimmed set) and guard theskillssection withisinstance(..., dict). Applied atget_disabled_skills, the single resolver every caller uses. Main's union semantics (global | platform) are preserved exactly — only the coercion is hardened.Scope / risk — One helper + guards in one function. List-shaped configs behave identically (verified by the existing 30 tests); only scalar/None shapes change (now tolerant instead of wrong/crashing).
Changes from original
Verification
Real behavior proof
Credit: salvage of #14094 by @LeonSGP43 — rebased onto current main with guardrail tests.