Conversation
Attempts only rise on one producer, so a lower one means the store reordered two generations. Saying so beats rendering the stale one as current.
…kwards-attempt-warning.
This was referenced Oct 3, 2026
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.
This PR makes a stream reader say so when a producer's attempt number goes backwards, instead of yielding the older generation as ordinary data.
What changed?
AttemptTrackertakes an optionalwarncallback. When a record arrives from an attempt lower than one already delivered for the same producer, it reports it with the topic, the position and both attempt numbers.RecordDecoderpasses its existingwarnthrough, so every provider's reader gets this for free.test_streams_internals.py: one for a backwards attempt, and one showing that a repeat of the current attempt stays quiet.Part of AI-198 (epic AI-37).
Why?
Attempts only ever rise on one producer. A lower one means the store handed back two generations out of order, and a consumer that renders it as the current answer shows something stale. The external mirror of this interface already carried this fix. It lands here so both chains behave the same.
How did you test it?
Link to a test plan if any -
poe lintis clean and the internals cases pass, the two new ones included.