fix: add missing reset_cache() function in hermes_time#13487
Open
hobostay wants to merge 1 commit into
Open
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>
HeLLGURD
added a commit
to HeLLGURD/hermes-agent
that referenced
this pull request
Jun 6, 2026
Salvaged from NousResearch#13487 (hobostay). reset_cache() is referenced in module docstrings/comments but was never defined; calling it raises AttributeError. Re-verified absent on current main. Co-authored-by: hobostay <hobostay@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
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