feat(ai): experimental callbacks for streamText#12708
Merged
aayush-kapoor merged 17 commits intomainfrom Feb 20, 2026
Merged
Conversation
4 tasks
lgrammel
reviewed
Feb 20, 2026
| export type StreamTextOnStartCallback< | ||
| TOOLS extends ToolSet = ToolSet, | ||
| OUTPUT extends Output = Output, | ||
| > = (event: { |
Collaborator
There was a problem hiding this comment.
can the events be extracted (from generate and stream text into XXXEvent types/interfaces) or are there differences?
Collaborator
Author
There was a problem hiding this comment.
extracted - changed for generateText as well
lgrammel
approved these changes
Feb 20, 2026
aayush-kapoor
added a commit
that referenced
this pull request
Feb 20, 2026
## Background as a follow up to #12654, we will introduce the same callbacks for the `ToolLoopAgent` ## Summary - added callback `experimental_onStart` that exposes the data/events that happen at the very beginning - added callback `experimental_onStepStart` - added callback `experimental_onToolCallStart` - added callback `experimental_onToolCallFinish` ## Manual Verification ## Future Work - callbacks aren't currently passed through for streaming - will need to merge #12708 first ## Checklist - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)
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.
Background
as a follow up to #12654, we will introduce the same callbacks for streamText function
Summary
experimental_onStartthat exposes the data/events that happen at the very beginningexperimental_onStepStartexperimental_onToolCallStartexperimental_onToolCallFinishManual Verification
Checklist
pnpm changesetin the project root)Future Work