Repository navigation
Conversation
moetemp
force-pushed
the
moe/brook/review/s10-chat-app
branch
from
November 6, 2026 18:53
5e21c87 to
3332d2d
Compare
…view decisions The facade delegates `create_stream`/`get_stream` to the regenerated nexgen client and matches the approved API. Renamed `publish`/`subscribe` to `append`/`read`, added the opaque `StreamOffset`, collapsed the errors onto reason-coded `StreamError`, and made `producer()` a module-level context manager. Dropped `create_or_get_stream` and `to_stream`, and moved Retention onto the backends.
Owner
Author
|
Closed in favor of #381, the combined branch, which has this change. |
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 was changed
This PR adds a small chat app in
tests/contrib/streams/examples/chat_app/that uses most parts of the Streams API.ChatSessionWorkflow with an agent loop. One message can take several rounds: a model round, tool calls, tool results, the next round, and the answer. Each round streams its tokens to a tokens Stream, and each round, tool call and tool result is a Turn in the turns Stream.add_messageSignal adds a message during a run. It shows the Turn at once withpublish_nowait, and the message joins the next round.researchtool starts a child Workflow that creates its own Streams under ids it picks, and passes their refs to the parent. The page opens it as a nested panel.Supersededitem crosses out the failed tokens. A reload or a server restart resumes each read at the tab's saved offset. Continue-as-new happens between turns, and the next run keeps the Streams.client.create_stream. Each copy keeps the Turn's offset and Producer in the chat.CHAT_MODEL_PROVIDERor by which key is set. The app reads no key itself, and a failed call keeps only the error's class.README.mdlists where each API feature is used.Why?
It shows how the API reads in a real app, not only in examples. The app also found a bug in the Workflow
_nowaitwrites, which #377 fixes.The app uses today's names (
publish,subscribe,BufferedPublisher,create_or_get_stream). It changes with the renames after the API review. A live Claude run with tool rounds works. OpenAI was checked only against a local stand-in. The fix for an end signal during continue-as-new has no test, since the race can't be timed reliably.Part of the Streams review series.
Checklist
poe lint, and the Streams suite with the app tests on both backends with Redis.