Repository navigation
Conversation
An agent's events in Redis outlive its Workflow, and a reader can leave and resume at its offset. The test isn't collected and mypy skips the sample until the two packages have a release, so CI stays green on the released temporalio.
A Stream has no close in the current Streams API. The Workflow writes the status event Done in finally, and each reader breaks at it.
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 adds a Redis Streams sample with resumable agent events. The Activity writes fixed tokens, so no model service is required.
Update-with-Start makes the Stream ref available even if the Workflow finishes before the reader starts. Cancellation waits for the writer to stop before adding
Done. A patch guard preserves recorded cancellation behavior. The client also observes the Workflow result because termination can prevent the final event.Worker and Redis integration tests passed, along with offline replay, Ruff and focused mypy checks. The type checks used the reviewed SDK with the sample's baseline CI exclusion removed. Collection skips the sample when the unreleased packages are absent. An installed broken package fails collection.
Reviewer's guide
streams_redis/README.md. It covers unreleased builds, Redis requirements, offset resume and repeated tokens from Activity retries.agent_workflow.py,model_activity.pyandrun_agent.py. Check atomic ref acquisition, cancellation, terminal ordering and result observation.tests/streams_redis/agent_workflow_test.py. It checks late readers, running cancellation and termination. The saved History protects replay of the earlier cancellation behavior.