You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: [Bug]: get_latest raises TypeError when a storage holds naive and timezone-aware checkpoint timestamps #9941
WorkflowCheckpoint.timestamp is documented as an "ISO 8601 timestamp", and both 2026-01-01T00:00:00 and 2026-01-02T00:00:00+00:00 are. get_latest compares them with datetime.fromisoformat, so a storage holding one of each raises TypeError, on InMemoryCheckpointStorage and FileCheckpointStorage alike. The default timestamp is aware, so this takes a checkpoint whose timestamp was supplied, for example one written by another tool.
Expected Behavior
get_latest returns the newest checkpoint, for example reading a naive timestamp as UTC, or the save rejects a naive timestamp.
On main the comparison is in the max(datetime.fromisoformat(cp.timestamp) for cp in checkpoints) of _workflows/_checkpoint.py. The open #9902 changes how get_latest handles a decode failure; its diff adds no timezone handling.
Acknowledgements
I searched existing issues and did not find a duplicate.
I personally verified this behavior and the reproduction details are authentic.
I will wait for explicit maintainer agreement before starting implementation of a non-trivial change.
🤖 Automated triage reproduction notes(agent-authored — trust but verify)
Agent analysis
The bug reproduces in python/packages/core/agent_framework/_workflows/_checkpoint.py::_select_latest_checkpoint at line 217 when one workflow contains both naive and timezone-aware ISO 8601 checkpoint timestamps. Minimal repro: save checkpoints timestamped 2026-01-01T00:00:00 and 2026-01-02T00:00:00+00:00 to either core storage implementation, then call get_latest(workflow_name="w").
/plan Resolve the confirmed mixed naive/aware checkpoint timestamp failure on current main before selecting the policy in #9944. Compare treating offset-naive ISO timestamps as UTC with rejecting them at a supported boundary; document compatibility for existing checkpoints and externally supplied timestamps. Preserve aware-offset ordering and existing lineage/tie-break semantics, and cover both InMemoryCheckpointStorage and FileCheckpointStorage, mixed/all-naive/all-aware values, equivalent instants, and invalid timestamp behavior. Coordinate with the existing #9944 implementation and the distinct #9902 decode-error work rather than creating a parallel fix. This is scoped planning, not implementation approval or a request to change assignments.
Activity
github-actions commentedon Nov 1, 2026
🤖 Automated triage reproduction notes (agent-authored — trust but verify)
Agent analysis
The bug reproduces in
python/packages/core/agent_framework/_workflows/_checkpoint.py::_select_latest_checkpointat line 217 when one workflow contains both naive and timezone-aware ISO 8601 checkpoint timestamps. Minimal repro: save checkpoints timestamped2026-01-01T00:00:00and2026-01-02T00:00:00+00:00to either core storage implementation, then callget_latest(workflow_name="w").python/packages/core/tests/workflow/test_checkpoint.py::test_get_latest_compares_naive_and_aware_timestamps1.23.01.24.0eavanvalkenburg commentedon Nov 2, 2026
/plan Resolve the confirmed mixed naive/aware checkpoint timestamp failure on current main before selecting the policy in #9944. Compare treating offset-naive ISO timestamps as UTC with rejecting them at a supported boundary; document compatibility for existing checkpoints and externally supplied timestamps. Preserve aware-offset ordering and existing lineage/tie-break semantics, and cover both InMemoryCheckpointStorage and FileCheckpointStorage, mixed/all-naive/all-aware values, equivalent instants, and invalid timestamp behavior. Coordinate with the existing #9944 implementation and the distinct #9902 decode-error work rather than creating a parallel fix. This is scoped planning, not implementation approval or a request to change assignments.