Skip to content

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

Open
moedash wants to merge 5 commits into
moe/AI-198-if-pyext-11-redis-activity-ownersfrom
moe/AI-198-if-pyext-12-redis-start-positions
Open

moedash wants to merge 5 commits into
moe/AI-198-if-pyext-11-redis-activity-ownersfrom
moe/AI-198-if-pyext-12-redis-start-positions

Conversation

@moedash

@moedash moedash commented Oct 3, 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: 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 for 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

poe lint is clean, and the transport commit type-checks and passes its tests on its own. The external stream suite passes on the dev server. The streams suite with STREAMS_LIVE=redis passes against a channel 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.
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