feat(ai): add experimental callbacks in generateText#12654
Merged
aayush-kapoor merged 30 commits intomainfrom Feb 19, 2026
Merged
feat(ai): add experimental callbacks in generateText#12654aayush-kapoor merged 30 commits intomainfrom
aayush-kapoor merged 30 commits intomainfrom
Conversation
aayush-kapoor
commented
Feb 18, 2026
4 tasks
Collaborator
|
For future PRs, we need something like onGenerationStart/onGenerationEnd that bounds the LLM call (not the full step) |
lgrammel
reviewed
Feb 18, 2026
lgrammel
reviewed
Feb 18, 2026
lgrammel
reviewed
Feb 18, 2026
lgrammel
approved these changes
Feb 19, 2026
aayush-kapoor
commented
Feb 19, 2026
| | undefined, | ||
| experimental_context, | ||
| }); | ||
| } catch (_ignored) { |
Collaborator
Author
There was a problem hiding this comment.
future work: figure out how to log this; don't want to swallow errors
This was referenced Feb 19, 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 streamText function ## 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 ## 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) ## Future Work - add similar callbacks for the agent loop
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)
4 tasks
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
our current telemetry setup was heavily integrated with OTel. this is the first step in decoupling the telemetry from the core functions
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