Repository navigation
Conversation
commit: |
robelest
force-pushed
the
fix/388-step-saves-v3
branch
from
November 9, 2026 15:52
3f4046f to
cd15193
Compare
, #419, #428) onStepEnd holds the step, prepareStep saves it with the next pending message in one mutation, and a transform saves the last one before `finish` reaches the caller, finishing its stream in the same mutation. A stream that ends without `finish`, on an error or a stopStream, fails the step it cut off there, before the result resolves. A failure, or a failed step, ends the SDK's loop through stopWhen, and keeps the steps that ended: an abort stops what hasn't finished. A failed message's stream ends aborted. The generation runs to its end whoever reads the stream. willContinue is gone, and a caller's onStepEnd now runs before its step is saved, after its usage is reported.
robelest
force-pushed
the
fix/388-step-saves-v3
branch
from
November 9, 2026 16:05
cd15193 to
9f96b67
Compare
robelest
marked this pull request as ready for review
November 9, 2026 23:10
ianmacartney
requested review from
sethconvex
and removed request for
ianmacartney
November 10, 2026 00:11
This branch has not been deployed
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.
Steps are now saved from the AI SDK's hooks instead of being predicted.
onStepEndholds the step.prepareStepsaves it in one mutation with the next pending message. A transform saves the last step beforefinishreaches the caller, and finishes the stream in that same mutation (#181).willContinueis gone.The transform uses
experimental_transformbecause the AI SDK has no stable hook that runs after the last step and beforefinish.Failures:
onErrorandfullStream, and the stream ends aborted.stopStreamfails instead of staying pending.Observable changes:
onStepEndruns before its step is saved, and itsonEndafter the last one.This answers the review on #397: no state machine copying the SDK's behaviour, each save runs in the hook where the SDK has already decided what comes next.
Closes #388, closes #419, closes #428.
Supersedes #397.