fix(cli): guard .strip() against None values from YAML config#3217
Closed
erosika wants to merge 2 commits intoNousResearch:mainfrom
Closed
fix(cli): guard .strip() against None values from YAML config#3217erosika wants to merge 2 commits intoNousResearch:mainfrom
erosika wants to merge 2 commits intoNousResearch:mainfrom
Conversation
…search#3214) dict.get("key", "") returns None (not "") when the key exists with a null YAML value. Use (value or "").strip() to handle this safely in model config resolution and custom provider parsing.
This was referenced Mar 27, 2026
Same YAML null pattern — _model_config.get("base_url", "") returns
None when the key exists with null value, crashing the `in` operator.
teknium1
pushed a commit
that referenced
this pull request
Mar 28, 2026
dict.get(key, default) only returns default when key is ABSENT. When YAML has 'key:' with no value, it parses as None — .get() returns None, then .strip() crashes with AttributeError. Use (x or '') pattern to handle both missing and null cases. Co-authored-by: erosika <erosika@users.noreply.github.com> Salvaged from PR #3217.
teknium1
added a commit
that referenced
this pull request
Mar 28, 2026
dict.get(key, default) only returns default when key is ABSENT. When YAML has 'key:' with no value, it parses as None — .get() returns None, then .strip() crashes with AttributeError. Use (x or '') pattern to handle both missing and null cases. Salvaged from PR #3217. Co-authored-by: erosika <erosika@users.noreply.github.com>
Contributor
|
Merged via PR #3552. Your fix was cherry-picked onto current main with authorship preserved. Thanks for catching the YAML null → .strip() crash! |
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
…search#3552) dict.get(key, default) only returns default when key is ABSENT. When YAML has 'key:' with no value, it parses as None — .get() returns None, then .strip() crashes with AttributeError. Use (x or '') pattern to handle both missing and null cases. Salvaged from PR NousResearch#3217. Co-authored-by: erosika <erosika@users.noreply.github.com>
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
dict.get("key", "")returnsNone(not"") when the key exists with a null YAML value(value or "").strip()in model config resolution and custom provider parsing'NoneType' object has no attribute 'strip'crash on startupCloses #3214