Repository navigation
Conversation
A source takes target="workflow" or target="client", and a field can have one of each. The client target passes the client source in each request, since the models are shared. It refuses only a field whose single source is for the workflow target.
Owner
Author
|
Closed for now. Brook's generated Stream client is private in sdk-python, behind the SDK's own Stream API, so this doesn't change what a user writes. It can come back with native Streams, where the generated API is the user API. |
This was referenced Oct 28, 2026
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 lets a
@nexus.sourcename the target it fills, withtarget="workflow"ortarget="client". A field can have one source for each target. A source with no target fills every target, as before.sourced-fieldfixture keeps that refusal, now withtarget="workflow".option, since the workflow target can leave it unset.optionfield gets aNoneguard in the proto converter.Depends on #75 (UPSTREAM-17).
Part of the Brook review series.
Why?
Brook's writes carry context fields that a user never sets, such as the
producer. In a Workflow they come from the run, in an Activity from its attempt, and in a client from the client. The client target refused every sourced field, so each SDK filled them by hand. The client target runs in Activities and clients alike, so one client helper serves both, and it can checktemporalio.activity.in_activity()at run time.temporalio/nexgen#301asked for this.How did you test it?
The streaming example's
append-records-requestgets aproducerwith a workflow source and a client source. The client test checks that a call outside a Workflow sends the client producer. Four new parser fixtures cover a duplicate target, a mixed untargeted and targeted source, an unknown target, and a required field with only a client source.cargo validatepasses. It's one commit, since today's parser refuses two sources on one field, so there's no output to compare.