Repository navigation
Conversation
The SDK moved the API to `temporalio.common.streams` and the Redis and memory backends to `temporalio.contrib.stream`. `stream_backends_from_env` gives the backend with `default=True`, since `Client.stream` reads a handle with no backend on it.
A release has no `stream_backends=`, so `stream_backend_options` passes the option only when `STREAMS_STORE` is set. The docstrings name `temporalio.common.streams`.
It adds only a docstring to 74b759cf, so the lanes that ran on 74b759cf stand: memory 925 passed, Redis 923 passed, conformance 54 on each.
Regenerated with nexgen v0.2.2, the version in the generated headers. The Python models keep two older docstring wraps that v0.2.2 does not make, so the diff is the four fields.
An SDK rename of the private id helper would break every agent's Stream with no type error. The write path keeps _append, since no public call gives the write's future.
One UNAVAILABLE in a quiet stretch ended the attach, though the agent still ran.
Each StreamItem has offset 0 there. The contract keeps its shape, and the generated files change only in the field's comment (nexgen v0.2.2).
p35 moved the Streams API out of temporalio.common.streams and loads its names on first use. So the tests check for the names with hasattr, and the fake release hides temporalio.common._streams.
publish now starts the write and returns its future, so the private _append call goes. The done callback takes a refused write's error, so the run doesn't fail at its end.
1 of 3 tasks
Owner
Author
|
Closed in favor of the review series. The net change of #6 and this PR is H1, #8, cut fresh onto upstream |
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.
This PR ports the harness to the reviewed Streams API of sdk-python p35 and fixes the harness findings of an independent review.
p35 renamed the Streams API, moved it into
temporalio.common, and made each process register its Stream backend on the client. The harness uses Streams for agent events, so every Stream import and call site changes.What changed?
Port.
temporalio.common, such ascommon.defn,common.topic,common.StreamBackendandActivityStream. Redis comes fromtemporalio.contrib.stream.stream_backends_from_env()replacesstreams_from_env(), and each process registers it withstream_backends=. The env backend hasdefault=True.client.stream(...)replacesStreamClient(client).get_handle(...). Reads useoffset=andtopic_prefixes=.temporalio.common. They're regenerated with nexgen v0.2.2, the version of the checked-in files, so only the descriptions change. The Go and TypeScript comments name it too. Thegenerate-from-localtarget of theui_connectorMakefile uses the contract underpython/.temporaliocheck for the Streams API withhasattr(temporalio.common, "ActivityStream"), since the names load on first use.justfilepins p35415fb36a.Review fixes.
WorkflowHandle.stream, not from the private_idsmodule. So its place names the default backend of the client, the same as the agent's ownAgentStream.ContribSink._writewrites each event with the publictopic(name, type=AgentEvent).publish(event), not the private_append. Its done callback gets the error of a refused write, so only that event is lost and the run doesn't fail at its end.UNAVAILABLE,DEADLINE_EXCEEDED,RESOURCE_EXHAUSTEDandABORTEDfrom describe.NOT_FOUNDstill ends it, and other errors raise.pollMessagesgivesoffset=0on a Stream. So a caller can't applyattempt_superseded, and a retried model call shows the text of both attempts. Thestream_mergedocs nameattach(resume=...). The comments use literal wording.Known limits.
pollMessagesthe Record offsets is deferred.Why?
p35 changed the API, so the harness had to change with it. The independent review of Brook and Jetty also found private SDK calls on the default write path and an SSE read that ended on a transient error. Some docs didn't match the code.
How did you test it?
On the pinned p35
415fb36a, the memory lane and the Redis lane pass. A new test checks that a refused write loses its event and doesn't fail the run. The read test checks thatUNAVAILABLEdoesn't end a read andPERMISSION_DENIEDraises, and it fails without the fix.go test ./agent/...andgo vetinnexus/ui_connectorpass.bazel test //typescript/packages/client/... //typescript/apps/ui/...passes. The tests for a releasedtemporaliopass against the release. The fork has no CI for this branch.The superproject branch
temporalio/internal-ai-prototypes2026/10/ai198-streamspins the head,909bdec4.