Implement Runner streaming and stateless execution#142
Open
Conversation
kalenkevich
reviewed
Feb 13, 2026
Collaborator
kalenkevich
left a comment
There was a problem hiding this comment.
can we please also include some tests for those changes?
kalenkevich
reviewed
Feb 13, 2026
core/src/runner/runner.ts
Outdated
| * @param event The internal Event. | ||
| * @yields The AgentEvent stream. | ||
| */ | ||
| private *convertEventToAgentEvents( |
Collaborator
There was a problem hiding this comment.
this actually can be just a function but not part of the class method
kalenkevich
reviewed
Feb 13, 2026
| newMessage: Content; | ||
| stateDelta?: Record<string, unknown>; | ||
| runConfig?: RunConfig; | ||
| }): AsyncGenerator<AgentEvent, void, undefined> { |
Collaborator
There was a problem hiding this comment.
Why do we need to stream AgentEvent but not just default ADK Event. What is the use case?
Collaborator
Author
There was a problem hiding this comment.
You're right, I believe we could return Event directly.
While I'd argue this API is a lot cleaner for the caller and saves the client work, it is lossy, and adds code.
Let me think overnight on this, since if we want to drop AgentEvent from streaming (which might well be the right suggestion, thank you!) I'll go back and revise it all over.
Thanks @kalenkevich!
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 implements
runStreamandrunStatelessmethods in theRunnerclass.runStream: Returns anAsyncGenerator<AgentEvent>for streaming execution, yielding standardized events.runStateless: Helper to create an ephemeral session, run a streaming execution, and cleanup afterwards.convertEventToAgentEvents: Internal mapper fromEventto standardizedAgentEvent.Reference:
docs/adk-ts-improvements.md.Fixes #141.