Repository navigation
fix(probe): message ids no longer repeat within a clock tick - #140
Merged
Merged
Conversation
fylorn
force-pushed
the
fix/probe-message-id
branch
from
September 23, 2026 12:30
8cb14c3 to
7b31249
Compare
Probe replies got their id from an xorshift seeded with the current time in nanoseconds. The clock is coarser than that, so two probes answered at the same moment carried the same id; generating 1000 in a row gave 733 distinct ones. rand was already a dependency of this crate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fylorn
force-pushed
the
fix/probe-message-id
branch
from
September 23, 2026 12:44
7b31249 to
680f28b
Compare
Merged
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.
Found while running the suite for another change:
message_ids_look_like_anthropic_ids_and_do_not_repeatfailed once with two identical ids.message_id()seeded an xorshift with the current time in nanoseconds. The clock is coarser than a nanosecond, so two probe replies generated in the same tick carried the samemsg_01…id. With the strengthened test, the old implementation yields 733 distinct ids out of 1000.It now draws each character with
rand::random_range, astw-config's key generator already does;randwas already a dependency of tw-gateway. The test additionally generates 1000 ids and requires all to be distinct.🤖 Generated with Claude Code