Conversation
…search#1119) When users explicitly set at_hour or idle_minutes to null in config.yaml, the from_dict() method now correctly applies default values. Python's dict.get() only returns defaults when keys are missing, not when keys exist with None/null values. This caused TypeError when comparing None with integers during validation. Changes: - Update SessionResetPolicy.from_dict() to explicitly check for None values - Add comprehensive tests for null value handling Fixes NousResearch#1119
Contributor
Author
|
Closing as superseded by #1194, which merged the same null handling fix along with the API timeout feature. Thanks! |
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
When users explicitly set
at_houroridle_minutestonullin theirconfig.yaml, the gateway previously failed with aTypeError. This PR fixes that by properly handlingnullvalues inSessionResetPolicy.from_dict().Problem
Python's
dict.get()only returns the default value when a key is missing, not when the key exists with aNone/nullvalue:Solution
Explicitly check for
Nonevalues before applying defaults:Changes
gateway/config.py: UpdateSessionResetPolicy.from_dict()to handlenullvaluestests/gateway/test_config.py: Add regression tests for null value handlingTesting
All existing tests pass, plus new tests for:
Fixes #1119