Skip to content

Python: break get_latest timestamp ties with the checkpoint lineage chain - #8514

Open
Manohar Paturi (ManoharPaturi) wants to merge 6 commits into
microsoft:mainfrom
ManoharPaturi:fix/get-latest-lineage-tiebreak
Open

Manohar Paturi (ManoharPaturi) wants to merge 6 commits into
microsoft:mainfrom
ManoharPaturi:fix/get-latest-lineage-tiebreak

Conversation

@ManoharPaturi

Copy link
Copy Markdown
Contributor

Fixes #8513.

Both get_latest implementations first drop every checkpoint that another one supersedes via previous_checkpoint_id (the ordering the WorkflowCheckpoint docstring already defines), then compare timestamps among the remaining tips. Unrelated chains and storages without lineage metadata fall back to the previous behavior.

Regression test saves a parent/child pair with identical timestamps in both orders and asserts the child always wins; it fails on main. Checkpoint suite green.

Manohar paturi and others added 6 commits September 14, 2026 09:51
…ming and post-stream parsing

Define is_pydantic_response_format once and reuse it to drive both
skip_text and post-stream structured output recovery, preventing
the two paths from drifting.
…hain

Identical timestamps at a superstep boundary made max() pick whichever
checkpoint the storage iterated first, so get_latest could return a
stale checkpoint depending on save order. Both storages now first drop
every checkpoint that another one supersedes via previous_checkpoint_id
and only then compare timestamps.

Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@agent-framework-automation agent-framework-automation Bot added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python labels Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: get_latest timestamp ties return a checkpoint chosen by save order, can restore stale state

2 participants