Repository navigation
Conversation
6 tasks done
moetemp
force-pushed
the
moe/streams-api
branch
from
November 14, 2026 02:14
566c3ec to
fc6b8d3
Compare
This was referenced Nov 14, 2026
2 of 3 tasks
moetemp
force-pushed
the
moe/streams-generated-code
branch
from
November 15, 2026 18:51
434ddd3 to
d70f12d
Compare
moetemp
force-pushed
the
moe/streams-api
branch
from
November 15, 2026 18:51
4c5003d to
09d01f5
Compare
moetemp
force-pushed
the
moe/streams-generated-code
branch
from
November 15, 2026 20:23
d70f12d to
6b44118
Compare
moetemp
force-pushed
the
moe/streams-api
branch
from
November 15, 2026 20:23
09d01f5 to
acf7b46
Compare
moetemp
force-pushed
the
moe/streams-generated-code
branch
from
November 16, 2026 17:14
6b44118 to
f330b20
Compare
moetemp
force-pushed
the
moe/streams-api
branch
from
November 16, 2026 17:14
acf7b46 to
5c6e8a8
Compare
moetemp
force-pushed
the
moe/streams-generated-code
branch
from
November 16, 2026 17:33
f330b20 to
31151f2
Compare
moetemp
force-pushed
the
moe/streams-api
branch
from
November 16, 2026 17:33
5c6e8a8 to
d6d4073
Compare
moetemp
force-pushed
the
moe/streams-generated-code
branch
from
November 16, 2026 19:42
31151f2 to
e8898ec
Compare
moetemp
force-pushed
the
moe/streams-api
branch
from
November 16, 2026 19:42
d6d4073 to
d6dda76
Compare
moetemp
force-pushed
the
moe/streams-api
branch
from
November 18, 2026 02:13
9367bfa to
1b73059
Compare
moetemp
force-pushed
the
moe/streams-api
branch
from
November 22, 2026 01:10
f93c959 to
fab988c
Compare
moetemp
force-pushed
the
moe/streams-api
branch
2 times, most recently
from
November 22, 2026 03:31
4f48bab to
066b280
Compare
This was referenced Nov 22, 2026
This was referenced Nov 27, 2026
moetemp
force-pushed
the
moe/streams-api
branch
5 times, most recently
from
December 2, 2026 07:28
7258a4d to
c15c1d4
Compare
`datetime.fromtimestamp(0)` reads the local time zone, so on a host west of UTC the default times of `ActivityEnvironment` fall before 1970. SDK Core and the client both refuse a Stream append whose Producer has an attempt time before 1970.
This Core has the Workflow commands and activation jobs of Stream appends and reads. A codec gets each Stream body alone and with no serialization context, and the passes of external storage skip Stream bodies, since any writer can make a body.
A Store is the service that keeps the Records of a Stream. The contract says what client, Activity and Workflow calls need from a Store, and `StreamConfig` registers the Stores of a client and its Workers.
Tests and local runs need a Store with no other service. The memory Store keeps its Streams in plain Python data and applies the rules of `StreamStore` in their order, so it also shows what a Store does.
An Activity that appends each model token pays one Store call for each token. The appender batches them with one write in flight, and stops at the first failed batch so that a reader sees no gap. `current_producer` and `as_producer` let resumed Activity work write as its first Producer.
The client sends each system Nexus call of the generated Stream API to the Store that its ref or the selector picks, with the codec and a request id that interceptor retries keep. It checks each request with the rules of SDK Core and the limits of the Stream config, so that client and Workflow calls refuse the same requests. An Activity writes as the Producer of its schedule, from the info that Core gives.
Each Stream operation of a client gets a typed hook on `OutboundInterceptor`, so interceptors see Stream calls without the generic Nexus chain. A hook that retries with the same input, or a copy, keeps its request id, and a call with no result type gets the type of its operation.
Workflow code can't call a Store itself, since a replay must get the same answers. Core runs each append on the Python Store through the bridge and records its result in History, and a create or a describe runs in a Local Activity of the SDK. In this commit a Workflow read reaches that Local Activity, which refuses it, so the Workflow Task fails.
A Stream create or describe runs as a Local Activity, and a Workflow Task that waits for one can complete with no command. Chunking merges such tasks in a replay, so Workflow code can get a result in another activation than in the first run. Core records the choice in the first completed Workflow Task, so a Workflow that started earlier keeps it.
Core runs each read and records the offset, the count and the digest of its page, so a replay reads the Records from the Store again and checks them. `stream_read_time` bounds how long reads keep a Workflow Task open, and `StreamReplayError` lets a Workflow fail when Records changed.
A ref in Workflow or Activity input must keep its body type, since a read converts each body to it. Only `StreamRef` takes the two new decoding paths, since a change for any other type would alter the replay of existing Workflow Histories.
moetemp
force-pushed
the
moe/streams-generated-code
branch
from
December 2, 2026 08:37
75cdfad to
a5779b7
Compare
moetemp
force-pushed
the
moe/streams-api
branch
from
December 2, 2026 08:37
c15c1d4 to
bd9eca2
Compare
This branch has not been deployed
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.
What was changed
This PR adds Streams for Python clients, Activities and Workflows.
StreamConfigregisters the Stores and the append limits. Workflow appends and reads run in Core. A create and a describe run in a Local Activity.Workflow reads remain a release stretch goal until notifications are available.
Why?
Records stay in the Store. History keeps the result of each call and a digest of each read, so a replay gets the same answers. A Store outage fails the Workflow Task. The Store must keep the Records for as long as the Workflow can replay.
Reviewer's guide
Review after the generated API. Merge both layers together. Read the 11 commits in order. Each one passes
poe lint, the docs build and its Stream tests alone.temporalio/client/_stream_store.py.temporalio/contrib/streams.Clientgetscreate_streamandget_stream.temporalio/worker/_workflow_streams.py, and the bridge code that lets Core call a Python Store. Alone, a Workflow read fails the Workflow Task (commit 10).stream_read_timeandStreamReplayError.StreamRef[T]in a dataclass, a list and an optional. OnlyStreamReftakes the new decoding paths.Checklist
poe lint, the docs build and the Stream tests pass on each commit.poe bridge-lintpass with the Core pin.