Fix flaky AgentModelsTest transcript-order (same-ms v7 tie)#68
Merged
Conversation
…tie) messages_append_and_transcript_reads_oldest_first appended two messages in the same millisecond, so neither created_at (second precision) nor the time-ordered v7 message_id could order them deterministically — transcript()'s message_id-DESC tiebreak fell to the v7 random bits, and the order flipped ~intermittently (green in #65, red in #67's CI run). Real conversation turns are seconds apart; force a created_at gap so the oldest-first assertion is deterministic. Verified stable across repeated runs. No source change — the model's ordering is correct for real use. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
AgentModelsTest::messages_append_and_transcript_reads_oldest_firstis timing-flaky: it appends two messages in the same millisecond, so neithercreated_at(second precision) nor the time-ordered v7message_idcan order them deterministically —transcript()'smessage_id DESCtiebreak falls to the v7 random bits, and the order flips intermittently (green in #65's CI, red in #67's).Real conversation turns are seconds/minutes apart, so
transcript()'s ordering is correct for production; only the test's unrealistically-fast appends are the problem. The fix forces acreated_atgap on the two messages so the oldest-first assertion is deterministic. Verified stable across repeated runs. No source change.🤖 Generated with Claude Code