Skip to content

Fix flaky AgentModelsTest transcript-order (same-ms v7 tie)#68

Merged
WebTigers merged 1 commit into
mainfrom
test/fix-flaky-transcript
Jul 24, 2026
Merged

Fix flaky AgentModelsTest transcript-order (same-ms v7 tie)#68
WebTigers merged 1 commit into
mainfrom
test/fix-flaky-transcript

Conversation

@WebTigers

Copy link
Copy Markdown
Owner

AgentModelsTest::messages_append_and_transcript_reads_oldest_first is timing-flaky: it appends two messages in the same millisecond, so neither created_at (second precision) nor the time-ordered v7 message_id can order them deterministically — transcript()'s message_id DESC tiebreak 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 a created_at gap on the two messages so the oldest-first assertion is deterministic. Verified stable across repeated runs. No source change.

🤖 Generated with Claude Code

…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>
@WebTigers
WebTigers merged commit 0f66ac7 into main Jul 24, 2026
11 checks passed
@WebTigers
WebTigers deleted the test/fix-flaky-transcript branch July 25, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant