Skip to content

feat(brook): add the Stream service messages (as experimental) - #895

Draft
moetemp wants to merge 9 commits into
mainfrom
moe/stream-service-messages
Draft

moetemp wants to merge 9 commits into
mainfrom
moe/stream-service-messages

Conversation

@moetemp

@moetemp moetemp commented Oct 26, 2026 •

Copy link
Copy Markdown

What changed?
This PR adds the Stream service messages, marked experimental.

  • stream/v1/message.proto has the shared types, streamservice/v1/request_response.proto the requests and responses, and enums/v1/stream.proto the enums.
  • StreamHandle.owner is the Workflow or Standalone Activity that owns the Stream.
  • A read returns StreamRecord items. Each one holds a Record, a StreamSuperseded item or the StreamClose.
  • CreateStream is create-or-get for the same owner. A Stream carries one payload type, so there are no Topics.
  • An append with sequence 0 takes the next number of its epoch.
  • StreamErrorDetails.reason is an enum, and each case names its gRPC code.
  • Fields of earlier drafts are reserved, since the SDK previews used them.
  • nexus/stream-service.wit is the Stream service WIT. The Makefile generates its records with a pinned nexgen fork, until a nexgen release has the directives it uses.
  • No service.proto yet.

Why?
The SDKs and the Redis Store already use these messages, so they need one home before a server serves them.

Breaking changes
None. These are new files.

Server PR
None needed for now.

@moetemp
moetemp requested review from a team October 26, 2026 16:37
@moetemp moetemp changed the title Added the Stream service messages as experimental. feat(brook): add the Stream service messages (as experimental) Oct 26, 2026
@moetemp
moetemp marked this pull request as draft October 26, 2026 16:53
@moetemp
moetemp force-pushed the moe/stream-service-messages branch 3 times, most recently from 482ec01 to 5068d41 Compare October 28, 2026 08:56
The crate, sdk-python and later the server read one copy of these messages. The gRPC service
and its Nexus annotations come with the server.
moetemp added a commit to moetemp/nexgen that referenced this pull request Oct 28, 2026
The Stream protos are A1's files again, and the runtime proto is K10's, so the sample matches
the crate. `CreateStreamResponse` has no `status` now. The descriptor set and the bindings are
rebuilt with the README's recipe.
moetemp added a commit to moetemp/nexgen that referenced this pull request Oct 29, 2026
The Stream protos are A1's files again, so the sample matches the crate. `CreateStreamResponse`
has no `status` now. The descriptor set and the bindings are rebuilt with the README's recipe.
@moetemp
moetemp force-pushed the moe/stream-service-messages branch from 5068d41 to 44519d8 Compare October 29, 2026 04:06
tconley1428 pushed a commit to temporalio/nexgen that referenced this pull request Oct 29, 2026
The sample takes the part of Brook's WIT that nexgen generates, on the Stream protos of
temporalio/api#895 at 44519d8a. No SDK has those protos, so the sample projects hold their
bindings. The sample is a System Nexus service, so its .NET output builds in its own project. Only
.NET generates the service, since Python and TypeScript panic on the read item's oneof.
The failure gives the close status, so the field only let a caller contradict it. An append with
no sequence gets the next batch number, so a call that has no writer state still works.
The SDKs copy this WIT to generate their Stream Workflow API and client. The Makefile runs
add-message on it, so its records follow the Stream protos. The fork has the directives the WIT
uses, until a nexgen release does.
moetemp added a commit to temporalio/nexgen that referenced this pull request Oct 31, 2026
…io (#311)

### What changed?
This PR moves the stream sample's Python bindings of the Stream protos into a local package, `temporalio_stream_protos/`, that installs them into `temporalio`. Only the sample changes. nexgen and the generated code stay as they are.

- The package adds only the Stream modules under `temporalio/api/`. The sample depends on it through a `uv` `path` source, and `streamprotos/` goes away.
- basedpyright now checks `wit/stream_service`.

### Why?
The Stream protos of `temporalio/api#895` aren't in a released `temporalio` yet. The generated code already imports them from `temporalio.api`, where a release will have them. When it does, the package goes away.

### How did you test it?
Link to a test plan if any -
- [x] Unit Tests
- [ ] Staging
- [ ] End to End Tests

`test_stream_service.py` round-trips each read item kind through the `temporalio.api` classes.
The message now has the name of the read item that it is. A StreamRef field is named ref
everywhere, as on CreateStreamRequest. The field numbers stay, so the wire format is the same.
moetemp added a commit to moetemp/nexgen that referenced this pull request Oct 31, 2026
The stream sample's WIT is the Stream service WIT of the protos PR, with the sample's own
definition, and its protos and bindings are those of the PR. The sample gains the
`withdraw_run` helper that the WIT's sources call.
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.

1 participant