fix: handle None skills config in skills_config helpers - #15501
Closed
Kailigithub wants to merge 1 commit into
Closed
fix: handle None skills config in skills_config helpers#15501Kailigithub wants to merge 1 commit into
Kailigithub wants to merge 1 commit into
Conversation
When skills is set to None in config.yaml, get_disabled_skills would
crash with AttributeError and save_disabled_skills would create a
broken state. Use `or {}` / `or []` guards and isinstance check to
handle None gracefully.
Collaborator
Collaborator
|
Duplicate of #13078 |
Contributor
|
Thanks for the null-config hardening work. This is an automated hermes-sweeper review; the reported behavior is now implemented on current main.
The PR’s getter hunk predates the current global-plus-platform union semantics, so it should not be applied over main. |
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.
When
skillsis set toNoneinconfig.yaml,get_disabled_skills()crashes withAttributeError: 'NoneType' object has no attribute 'get', andsave_disabled_skills()would overwrite the key with a dict without preserving the user's intent.Changes:
get_disabled_skills: useor {}/or []guards soNoneis treated the same as an absent keysave_disabled_skills: replaceconfig.setdefault("skills", {})with anisinstancecheck so a non-dict value (includingNone) is replaced rather than silently keptAll 28 existing tests in
test_skills_config.pypass; web-server skill endpoint tests also pass.Closes #15486