Skip to content

feat: send client and Activity Stream calls to Stores - #2129

Draft
moetemp wants to merge 15 commits into
moe/streams-storesfrom
moe/streams-api
Draft

moetemp wants to merge 15 commits into
moe/streams-storesfrom
moe/streams-api

Conversation

@moetemp

@moetemp moetemp commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

Client and Activity code can call Streams, and the SDK sends each call to its Store. Client gets create_stream and get_stream, and client interceptors can intercept each Stream operation. The Core pin moves to the append and replay work of #1882, with the bridge bindings regenerated.

Why?

A retry keeps its request id, so the Store can tell a resend from a new write and doesn't write the Records twice. An Activity names itself as the Producer with the scheduling event id from Core #1833. This PR doesn't need Core's Stream reads, so it can merge first.

Reviewer's guide

Review after #2186.

  1. Check the Core pin, the generated protos and the payload visitor together.
  2. Read temporalio/streams.py for how the SDK picks a Store. Then check validation, dispatch and the retry identity in temporalio/client/_stream_store.py.
  3. Check Tim's client hooks for each operation and their interceptor tests. Workflow appends and reads come in #2187 and #2188.

Checklist

  • Regenerate the bridge protos, the visitor and the client at the Core pin.
  • Run Python lint and the Stream tests.
  • Check the Producer identity against a local server.

@moetemp
moetemp added this pull request to stack #2130 November 14, 2026 01:00
@moetemp
moetemp removed this pull request from stack #2130 November 15, 2026 08:27
@moetemp moetemp changed the title feat: add the Streams API, with Stream Stores on Redis and in memory feat: add the Streams API for Activity and client code, with Stores on Redis and in memory Nov 17, 2026
@moetemp
moetemp added this pull request to stack #2139 November 18, 2026 01:19
@moetemp moetemp changed the title feat: add the Streams API for Activity and client code, with Stores on Redis and in memory feat: add the Streams API for Activity and client code Nov 18, 2026
@moetemp moetemp changed the title feat: add the Streams API for Activity and client code feat: add the Streams API for client, Activity and Workflow code Nov 22, 2026
@moetemp
moetemp force-pushed the moe/streams-api branch 2 times, most recently from 4f48bab to 066b280 Compare November 22, 2026 03:31
@moetemp moetemp changed the title feat: add Stream Stores and Workflow Stream calls feat: send client and Activity Stream calls to Stores Dec 2, 2026
@moetemp
moetemp added this pull request to stack #2189 December 2, 2026 22:49
@moetemp
moetemp removed this pull request from stack #2189 December 3, 2026 09:00
@moetemp
moetemp added this pull request to stack #2202 December 3, 2026 09:00
@moetemp
moetemp force-pushed the moe/streams-api branch 2 times, most recently from c0ae38a to 8cbd595 Compare December 3, 2026 10:14
@moetemp
moetemp force-pushed the moe/streams-api branch 3 times, most recently from 94e7d5e to 9e261d1 Compare December 4, 2026 00:26
moetemp and others added 15 commits December 6, 2026 01:40
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.
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.
Keep Python on the reviewed Core stack and use its task completion
metadata for Local Activity identity during replay.
Workflow appends and replay share one state machine. Regenerate the
bridge bindings from the same Core revision used by the Worker.
The docstrings say the same in fewer words. No code changes.
Core dropped the append rules that no replay observes and corrected its marker docs, so the pin moves and the stubs take the new comments.
Core gives a Local Activity the seq of the command that first scheduled it, and the Producer has it in place of the Workflow Task id. A retry keeps it, so the Workflow Task completion needs no list of pending Local Activities.
The bridge stubs take the new proto comments. No generated code changes.
Explain how a client or Activity Stream call reaches a Store, why
retries keep the request id, why Store errors become reasons, and why
Stream bodies skip external storage. Only docstrings and comments
change.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants