Conversation
A key is trimmed to a seven-day window by default, with an optional count cap, on every append the provider makes. A replay that reaches a trimmed range fails its task loudly, and an outside cursor below the window is refused.
The cases check the constructor's bounds, the seven-day default, a replay and a read past the window, the age trim, and a batch the window cannot hold.
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 trims the Redis provider's logs by age, and optionally by count, on every append.
What changed?
RedisStreams(retention=, max_len=), withDEFAULT_RETENTIONat seven days and no count cap by default. Both are checked at construction.max_lenis refused where it's staged.StreamIntegrityError, which the transport no longer wraps as a storage error. An outside cursor below the window is refused withStreamCursorError.Part of AI-198 (epic AI-37).
Why?
Without a trim, a Redis log grows forever. The trim has no consumer floor, because keeping one would need a consumer registry in Redis. So the failure modes are made loud instead: a replay past the window fails rather than replaying something else. Trims are exact because Redis's approximate trim never touches a log shorter than one macro node.
How did you test it?
Link to a test plan if any -
poe lintis clean. The external stream suite passes on the dev server. The streams suite withSTREAMS_LIVE=redispasses against a channel server and a local Redis.