Skip to content

Let a Redis workflow reader start at the tail or at the newest N. - #109

Open
moetemp wants to merge 4 commits into
moe/AI-198-s1-py-19-redis-activity-ownersfrom
moe/AI-198-s1-py-20-redis-start-positions
Open

moetemp wants to merge 4 commits into
moe/AI-198-s1-py-19-redis-activity-ownersfrom
moe/AI-198-s1-py-20-redis-start-positions

Conversation

@moetemp

@moetemp moetemp commented Oct 6, 2026

Copy link
Copy Markdown
Owner

This PR lets a workflow reader on the Redis provider start at the tail or at the newest N records.

What changed?

The transport gains StartAtTail, subscribe(start_at_tail=), a tail_cursor() hook on the backend, and resolve_pending_starts(), which the Worker calls before a completion goes out. RedisStreams answers stream_reader(after=END) and stream_reader(last=N) through that path instead of refusing. Replay cases cover both starts.

Part of AI-198 (epic AI-37).

Why?

The workflow thread can't ask the store where its tail is. So the transport records the request, and the Worker resolves it against the store after the task that opened the subscription. The marker records the boundary beside the subscription, so replay and a cold start read it from History and never ask the store again.

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

The lint set is clean. The external stream suite and tests/streams pass on the dev server the fixtures start. tests/streams with STREAMS_LIVE=redis passes against a stock dev server and a local Redis, including a reader at the newest N and one at END, each replayed.

The workflow thread cannot see where the store's tail is, so the transport
records the request, the Worker resolves it against the store after the task
that opened the subscription, and the marker records the boundary so replay
reads it from History.
…rds.

stream_reader(after=END) and stream_reader(last=N) on the Redis provider now
ask the transport for a tail start instead of being refused.
A reader at the newest N records and one at END each start where the live run
resolved, and replay starts there too.
@moetemp moetemp added the skip-changelog Changelog entry rides another PR label Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Changelog entry rides another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant