Skip to content

Backport pr 12456 to release v5.0#12464

Merged
ctate merged 4 commits intorelease-v5.0from
backport-pr-12456-to-release-v5.0
Feb 11, 2026
Merged

Backport pr 12456 to release v5.0#12464
ctate merged 4 commits intorelease-v5.0from
backport-pr-12456-to-release-v5.0

Conversation

@ctate
Copy link
Contributor

@ctate ctate commented Feb 11, 2026

This is a manual backport of #12456 to the release-v5.0 branch.

Summary

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.

Changes:

  • Added response.function_call_arguments.delta and .done to xaiResponsesChunkSchema
  • Added ongoingToolCalls tracking to stream arguments incrementally
  • Added handlers for function_call_arguments.delta/done and skip handlers for custom_tool_call_input.delta/done
  • Refactored function_call handling to emit tool-input-start on added and tool-call on done

Manual Verification

  • All 137 xai tests pass (node + edge)
  • E2E tested against real xAI API with grok-4-1-fast-reasoning and function tools

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added
  • I have reviewed this pull request (self-review)

…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.
@vercel-ai-sdk vercel-ai-sdk bot added the maintenance CI, internal documentation, automations, etc label Feb 11, 2026
@ctate ctate changed the base branch from main to release-v5.0 February 11, 2026 22:58
'@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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

unit test changes are missing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch - added back

Copy link
Collaborator

Choose a reason for hiding this comment

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

is there an example script that fails before and passes after?

@ctate ctate enabled auto-merge (squash) February 11, 2026 23:20
@ctate ctate merged commit 93fff75 into release-v5.0 Feb 11, 2026
19 checks passed
@ctate ctate deleted the backport-pr-12456-to-release-v5.0 branch February 11, 2026 23:27
@kohlweypatrick-cmyk
Copy link

Is forks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance CI, internal documentation, automations, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants