Skip to content

fix: add missing reset_cache() function in hermes_time#13487

Open
hobostay wants to merge 1 commit intoNousResearch:mainfrom
hobostay:fix/missing-reset-cache-hermes-time
Open

fix: add missing reset_cache() function in hermes_time#13487
hobostay wants to merge 1 commit intoNousResearch:mainfrom
hobostay:fix/missing-reset-cache-hermes-time

Conversation

@hobostay
Copy link
Copy Markdown

Summary

  • hermes_time.reset_cache() is referenced in module comments and docstrings but was never defined
  • Calling it would raise AttributeError at runtime
  • The test suite already works around this by directly manipulating module globals (_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. changing HERMES_TIMEZONE env var or updating config.yaml).

Test plan

  • Existing tests in tests/test_timezone.py validate cache behavior via direct global manipulation — the new function provides the canonical API for the same operation
  • Manual test: set HERMES_TIMEZONE, call hermes_time.now(), change timezone, call reset_cache(), verify now() reflects the new timezone

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant