Backport pr 12456 to release v5.0#12464
Merged
ctate merged 4 commits intorelease-v5.0from Feb 11, 2026
Merged
Conversation
…streaming events (#12456) Add support for `response.function_call_arguments.delta` and `response.function_call_arguments.done` streaming events in the xAI Responses API provider. Previously, xAI Grok models using function tools would fail with `AI_TypeValidationError` because these standard Responses API events were missing from the Zod schema and stream handler. This is a manual backport of #12456 to the release-v5.0 branch.
dancer
approved these changes
Feb 11, 2026
shaper
reviewed
Feb 11, 2026
| '@ai-sdk/xai': patch | ||
| --- | ||
|
|
||
| Add support for `response.function_call_arguments.delta` and `response.function_call_arguments.done` streaming events in the xAI Responses API provider. Previously, xAI Grok models using function tools would fail with `AI_TypeValidationError` because these standard Responses API events were missing from the Zod schema and stream handler. |
Collaborator
There was a problem hiding this comment.
nit: please make one short line summarizing, this goes in the npm package CHANGELOG, propose:
fix (provider/xai): fix responses api streaming function tool call type validation error
Collaborator
There was a problem hiding this comment.
unit test changes are missing
Contributor
Author
There was a problem hiding this comment.
Good catch - added back
Collaborator
There was a problem hiding this comment.
is there an example script that fails before and passes after?
shaper
approved these changes
Feb 11, 2026
|
Is forks |
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 is a manual backport of #12456 to the
release-v5.0branch.Summary
Add support for
response.function_call_arguments.deltaandresponse.function_call_arguments.donestreaming events in the xAI Responses API provider. Previously, xAI Grok models using function tools would fail withAI_TypeValidationErrorbecause these standard Responses API events were missing from the Zod schema and stream handler.Changes:
response.function_call_arguments.deltaand.donetoxaiResponsesChunkSchemaongoingToolCallstracking to stream arguments incrementallyfunction_call_arguments.delta/doneand skip handlers forcustom_tool_call_input.delta/donefunction_callhandling to emittool-input-startonaddedandtool-callondoneManual Verification
grok-4-1-fast-reasoningand function toolsChecklist