Skip to content

fix(ai): remove itemId from providerOptions for openai models#886

Closed
bhuvaneshprasad wants to merge 1 commit intovercel:mainfrom
bhuvaneshprasad:fix/openai-responses-api
Closed

fix(ai): remove itemId from providerOptions for openai models#886
bhuvaneshprasad wants to merge 1 commit intovercel:mainfrom
bhuvaneshprasad:fix/openai-responses-api

Conversation

@bhuvaneshprasad
Copy link

Fix DurableAgent + OpenAI Responses API failing on tool calls due to missing required reasoning item. The issue occurred because tool calls were forwarding itemId in providerMetadata, which requires a paired reasoning item that DurableAgent doesn't provide.

Changes:

  • Remove itemId from tool call providerMetadata
  • Add previousResponseId tracking for proper conversation continuity
  • Extract responseId from finish chunk and pass it in subsequent requests

The previousResponseId approach is sufficient for conversation continuity and avoids the duplicate item error that occurs when both previousResponseId and itemId are present.

Fixes #880

@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2026

⚠️ No Changeset found

Latest commit: fbcd78a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Contributor

vercel bot commented Jan 29, 2026

@bhuvaneshprasad is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@bhuvaneshprasad bhuvaneshprasad force-pushed the fix/openai-responses-api branch from 5f6a49f to daddac9 Compare January 29, 2026 09:53
Fix DurableAgent + OpenAI Responses API failing on tool calls due to
missing required reasoning item. The issue occurred because tool calls
were forwarding itemId in providerMetadata, which requires a paired
reasoning item that DurableAgent doesn't provide.

Changes:
- Remove itemId from tool call providerMetadata
- Add previousResponseId tracking for proper conversation continuity
- Extract responseId from finish chunk and pass it in subsequent
  requests

The previousResponseId approach is sufficient for conversation
continuity and avoids the duplicate item error that occurs when
both previousResponseId and itemId are present.

Fixes vercel#880

Signed-off-by: bhuvaneshprasad <98113536+bhuvaneshprasad@users.noreply.github.com>
@VaguelySerious
Copy link
Member

VaguelySerious commented Feb 26, 2026

Hi @bhuvaneshprasad, thanks for contributing! We're just now catching up on community PRs. Could you:

and then this should be good to merge

@VaguelySerious VaguelySerious self-requested a review February 26, 2026 18:48
@VaguelySerious
Copy link
Member

@bhuvaneshprasad Was this PR succeeded by #889 and now works for you as intended? Let me know if not, otherwise I'll close this PR after some time

@bhuvaneshprasad
Copy link
Author

Hi @VaguelySerious , the #889 should work. We can close this PR. Thanks

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: DurableAgent + OpenAI Responses API fails on tool calls due to missing required reasoning item

2 participants