Skip to content

feat(ai): add onStepFinish callback to createUIMessageStream#12448

Merged
aayush-kapoor merged 5 commits intomainfrom
aayush/onstepfinish-ui
Feb 11, 2026
Merged

feat(ai): add onStepFinish callback to createUIMessageStream#12448
aayush-kapoor merged 5 commits intomainfrom
aayush/onstepfinish-ui

Conversation

@aayush-kapoor
Copy link
Copy Markdown
Collaborator

Background

we expose onFinish callback for createUIMessageStream() but not onStepFInish, which is inconsistent with the pattern.

also reported in #12383

Summary

added the callback to the function + new type added

Manual Verification

  • verified by running localhost:3000/use-chat-human-in-the-loop

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Future Work

the callback might need to be added for createAgentUIStreamResponse

Related Issues

fixes #12383

@vercel-ai-sdk vercel-ai-sdk bot added the ai/ui anything UI related label Feb 11, 2026
Copy link
Copy Markdown
Collaborator

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, one question/suggestion

@aayush-kapoor aayush-kapoor merged commit ee4beee into main Feb 11, 2026
18 checks passed
@aayush-kapoor aayush-kapoor deleted the aayush/onstepfinish-ui branch February 11, 2026 22:01
@aayush-kapoor aayush-kapoor linked an issue Apr 9, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/ui anything UI related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add experimental callbacks to all core functions Expose UIMessages in onStepFinish for incremental persistence

2 participants