Conversation
A half-open range reads as `from_offset`/`to_offset` in the server's own protos, and AIP-140 rejects both names.
`make http-api-docs` picks up the stream slices on the poll response and the two new event types, so the committed specs were stale.
moedash
force-pushed
the
moe/AI-198-stream-protos
branch
from
September 16, 2026 22:30
d51ed68 to
2b05496
Compare
3 tasks
The server fails the task instead of the RPC when a stream command is rejected or a recorded range cannot be served, and needs causes the SDK can show.
The publish command comment claimed no event. The run id, message fields and name precedence had no comments.
The record is the wire format every store keeps and every language reads, so it carries its kind, producer, attempt and sequence itself instead of a private envelope inside the body. The body is the user's payload, so a codec applies to it like to any other payload.
The SDKs call an entry a record and a cursor a single position, and `temporal.api` already uses "message" for protocol envelopes. One noun on the wire keeps History readable next to user code.
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 changed?
This PR adds the public API surface for server-side streams: the two stream commands, the two event types, and the Workflow Task fields that carry consumed ranges. OpenAPI specs are regenerated.
from_offsetandto_offsetcarry an AIP-140 exemption, a rename would ripple into every vendored and generated copy.The record is the wire format.
StreamRecordcarries itskind(StreamRecordKind, unspecified reads as data),producer_id(empty when the owning Workflow wrote it),attemptandsequencenext tobody,metadataandtopic, so every store keeps the same bytes and a payload codec applies tobodylike to any other payload. The command isAppendStreamRecords, the event isWorkflowStreamRecordsAppendedwith arecord_count, a consumed range is aStreamRange, andWorkflowTaskCompletedEventAttributes.consumed_stream_rangessits at the end of the message. ThreeWorkflowTaskFailedCausevalues are added for a refusedAppendStreamRecordscommand, a refusedSubscribeStreamcommand, and a task whose recorded stream range can no longer be served. TheSubscribeStreamCommandAttributes.stream_idcomment states that an owned name is resolved before a standalone id.Fixes AI-198
Why?
A workflow's publish has to commit with its Workflow Task, and its reads have to be replayable. That needs first-class commands and events, not markers. Everything server-side in the prototype builds on these protos.
How did you test it?
Link to a test plan if any -
buf lint,buf breakingagainst upstreammain, api-linter and the codegen checks are green in CI. The server PR's functional tests exercise these shapes end to end.