🔴 Required Information
Describe the Bug:
Inconsistent timezone handling for PostgreSQL between create_session and append_event methods in DatabaseSessionService. The create_session method stores UTC time with timezone removed for PostgreSQL, while append_event method stores local time (no timezone parameter) for PostgreSQL. This inconsistency may cause StorageSession.update_time to have different time baselines depending on which method was called.
Steps to Reproduce:
- Set up ADK with PostgreSQL as the database backend
- Create a session using DatabaseSessionService.create_session()
- Append an event using DatabaseSessionService.append_event()
- Compare the create_time/update_time values in StorageSession table
- Observe that timestamps may have different time baselines (UTC vs local time)
Expected Behavior:
- Both create_session and append_event should handle PostgreSQL timestamps consistently, storing UTC time with timezone information removed for both methods.
Observed Behavior:
This can cause timestamps to be inconsistent when the server timezone differs from UTC.
Environment Details:
- ADK Library Version (pip show google-adk): 1.29.0
- Desktop OS:** Windows
- Python Version (python -V): 3.13
Model Information:
- Are you using LiteLLM: N/A
- Which model is being used: N/A
🔴 Required Information
Describe the Bug:
Inconsistent timezone handling for PostgreSQL between create_session and append_event methods in DatabaseSessionService. The create_session method stores UTC time with timezone removed for PostgreSQL, while append_event method stores local time (no timezone parameter) for PostgreSQL. This inconsistency may cause StorageSession.update_time to have different time baselines depending on which method was called.
Steps to Reproduce:
Expected Behavior:
Observed Behavior:
create_session (L461-L465): PostgreSQL uses UTC time with tzinfo=None
append_event (L731-L737): PostgreSQL uses local time (no timezone parameter passed to datetime.fromtimestamp())
This can cause timestamps to be inconsistent when the server timezone differs from UTC.
Environment Details:
Model Information: