Skip to content

fix(backend): normalize naive datetime from Redis in knowledge_manager (#3618)#3636

Merged
mrveiss merged 1 commit intoDev_new_guifrom
fix/3618-datetime-cache-comparison
Apr 7, 2026
Merged

fix(backend): normalize naive datetime from Redis in knowledge_manager (#3618)#3636
mrveiss merged 1 commit intoDev_new_guifrom
fix/3618-datetime-cache-comparison

Conversation

@mrveiss
Copy link
Copy Markdown
Owner

@mrveiss mrveiss commented Apr 7, 2026

Closes #3618

Summary

Root cause

PR #3615 migrated datetime.now() to UTC-aware, but pre-migration Redis data stored naive datetime strings. fromisoformat() returns naive datetimes which raise TypeError on comparison with UTC-aware datetimes. The surrounding except Exception: return False caught it silently, treating all pre-migration man page cache entries as expired.

Fix

Two lines added in _is_man_page_recent() after fromisoformat():

if last_updated.tzinfo is None:
    last_updated = last_updated.replace(tzinfo=timezone.utc)

This is the standard normalization pattern established in the #3615 migration (also applied in auth_middleware.py and agent_client.py).

#3618)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mrveiss mrveiss merged commit e8db08f into Dev_new_gui Apr 7, 2026
3 of 4 checks passed
@mrveiss mrveiss deleted the fix/3618-datetime-cache-comparison branch April 7, 2026 07:30
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

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