Skip to content

fix: normalize mixed datetime inputs#367

Open
sudo-yf wants to merge 1 commit into
volcengine:mainfrom
sudo-yf:fix/datetime-normalization
Open

fix: normalize mixed datetime inputs#367
sudo-yf wants to merge 1 commit into
volcengine:mainfrom
sudo-yf:fix/datetime-normalization

Conversation

@sudo-yf

@sudo-yf sudo-yf commented Jul 3, 2026

Copy link
Copy Markdown

Description

Closes #368.

Normalize mixed datetime inputs before comparisons so legacy local naive timestamps and newer ISO8601 Z/offset timestamps can coexist safely.

This addresses screenshot ingestion, vault monitoring, screenshot processing, scheduled consumption timers, and related context operations where aware datetimes could otherwise be compared with naive local datetime.now() values.

What changed

  • Added opencontext.utils.datetime_utils for local-naive datetime normalization.
  • Normalized ISO8601 Z/offset inputs at API/storage processing boundaries.
  • Updated screenshot ingestion to send ISO timestamps from the frontend.
  • Added regression tests for mixed datetime inputs.

Tests

  • python3 -m unittest tests/test_datetime_normalization.py
  • python3 -m py_compile opencontext/utils/datetime_utils.py opencontext/context_capture/vault_document_monitor.py opencontext/context_consumption/generation/smart_tip_generator.py opencontext/context_processing/processor/screenshot_processor.py opencontext/managers/consumption_manager.py opencontext/server/context_operations.py

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.

fix: normalize mixed timezone datetime inputs

2 participants