Repository navigation
Python: Normalize Foundry checkpoint timestamps for comparison - #10337
Open
WhaleTech (ryo-whaletech) wants to merge 1 commit into
Open
WhaleTech (ryo-whaletech) wants to merge 1 commit into
WhaleTech (ryo-whaletech) wants to merge 1 commit into
Conversation
Treat naive checkpoint timestamps as UTC when selecting the latest Foundry checkpoint. Compare normalized instants for newest selection and lineage ties while preserving the original timestamp strings in storage. Cover saved checkpoint selection for mixed naive and aware timestamps, equivalent instants, and both save orders without a newer Core helper.
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
November 13, 2026 10:49 — with
GitHub Actions
Active
WhaleTech (ryo-whaletech)
deployed
to
github-app-auth
November 13, 2026 10:49 — with
GitHub Actions
Active
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the checkpoint timestamp-comparison update.
No open issues 🎉
What changed in this PR
This PR aligns Foundry checkpoint selection with Core’s timestamp policy, fixing comparisons between naive and timezone-aware timestamps without changing persisted values or public APIs.
Changes:
- Treat naive timestamps as UTC during latest-checkpoint selection and candidate filtering.
- Preserve lineage and checkpoint-ID tie-breaking.
- Add six regression cases covering mixed timestamps, equal-instant lineage, both save orders, and unchanged stored timestamp strings.
| File | Description |
|---|---|
python/packages/foundry_hosting/tests/test_state_store.py |
Adds save/get-latest regressions for mixed timestamps and persistence preservation. |
python/packages/foundry_hosting/agent_framework_foundry_hosting/_state_store.py |
Adds a local timestamp parser and uses it for checkpoint comparisons. |
Review effort: Balanced
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
Foundry checkpoint selection raises
TypeErrorwhen saved checkpoints mix naive and timezone-aware ISO timestamps.Both representations pass through
save()andload(), but the selector cannot compare them. The default generatedtimestamps are aware; this affects supplied or existing naive timestamps.
Apply the comparison policy already used by Core after #9944
to the Foundry store.
Description & Review Guide
save()/get_latest()regressions covering naive-older, naive-newer, equal-instant lineage, and bothsave orders. Only the external SDK storage boundary is mocked.
TypeError.ValueError; the change does not catch or suppress storage failures.No dependency-floor increase or reliance on a newer private Core helper is introduced.
Local validation on
7a166e79e7a0025f3bc3a752e328f341cbaddf25with Python 3.11.14 on macOS arm64:Foundry Hosting gives 1,113 passed / 36 integration tests deselected. The frozen-workspace aggregate command
poe test -A -n 4gives 21,441 passed / 580 skipped / 5 xfailed. Strict source Pyright, all five test type checkers,Ruff lint/format, and changed-file pre-commit hooks pass (
poe-checkskipped as in CI).The released hosting wheel fails all six new cases with Core 1.25.0 and the direct SDK dependency floors.
Installing the locally built candidate wheel in the same environment gives 67 passing state-store tests. The
compatible lower-bound combination uses httpx2 2.5.0 because MCP 2.2.0 requires it. Dependency checks also pass.
Test runs include existing deprecation/experimental warnings; the aggregate run reports 1,494 warnings.
Linux/Windows runners and live-service integration tests were not run locally.
Related Issue
Fixes #10336
Maintainer agreement on this Foundry-specific follow-up has not yet been recorded.
AI Assistance
AI assistance details: Duplicate research, reproduction, diagnosis, implementation, regression tests, validation,
and this description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.