fix: add missing reset_cache() function in hermes_time#13487
Open
hobostay wants to merge 1 commit intoNousResearch:mainfrom
Open
fix: add missing reset_cache() function in hermes_time#13487hobostay wants to merge 1 commit intoNousResearch:mainfrom
hobostay wants to merge 1 commit intoNousResearch:mainfrom
Conversation
The reset_cache() function is referenced in module-level comments and docstrings but was never defined. This would cause an AttributeError if any caller tried to use it after a timezone configuration change. The test suite already works around this by directly manipulating the module globals (_cached_tz, _cached_tz_name, _cache_resolved), which confirms the function was intended to exist. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.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
hermes_time.reset_cache()is referenced in module comments and docstrings but was never definedAttributeErrorat runtime_cached_tz,_cached_tz_name,_cache_resolved)Fix
Adds the missing
reset_cache()function that clears the cached timezone state, allowing callers to re-resolve the timezone after configuration changes (e.g. changingHERMES_TIMEZONEenv var or updatingconfig.yaml).Test plan
tests/test_timezone.pyvalidate cache behavior via direct global manipulation — the new function provides the canonical API for the same operationHERMES_TIMEZONE, callhermes_time.now(), change timezone, callreset_cache(), verifynow()reflects the new timezone🤖 Generated with Claude Code