Skip to content

fix(openai): restore responses workflow deserialization#15589

Open
AVtheking wants to merge 1 commit into
vercel:mainfrom
AVtheking:fix-openai-workflow-deserialize
Open

fix(openai): restore responses workflow deserialization#15589
AVtheking wants to merge 1 commit into
vercel:mainfrom
AVtheking:fix-openai-workflow-deserialize

Conversation

@AVtheking
Copy link
Copy Markdown
Contributor

@AVtheking AVtheking commented May 24, 2026

Background

WorkflowAgent serializes model instances across workflow step boundaries. OpenAI Responses models stored their request URL as a function, which is stripped during workflow serialization. After deserialization, model calls could fail with this.config.url is not a function when using openai(...) directly.

Summary

  • Preserve the OpenAI Responses baseURL in serializable model config.
  • Rebuild the runtime url and headers functions during OpenAI Responses workflow deserialization.
  • Add a regression test covering serialize -> deserialize -> request for an OpenAI Responses model.

Manual Verification

Ran the focused OpenAI Responses test suite in both runtimes:

pnpm --filter @ai-sdk/openai test:node -- src/responses/openai-responses-language-model.test.ts
pnpm --filter @ai-sdk/openai test:edge -- src/responses/openai-responses-language-model.test.ts

Checklist

  • All commits are signed (PRs with unsigned commits cannot be merged)
  • 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

OpenAI-compatible and Azure use more complex URL builders. They can be handled in follow-up changes with provider-specific serializable URL metadata.

Related Issues

Fixes #15306

@AVtheking AVtheking force-pushed the fix-openai-workflow-deserialize branch from fb79c0b to ef71765 Compare May 24, 2026 15:42
Co-authored-by: Cursor <cursoragent@cursor.com>
@AVtheking AVtheking force-pushed the fix-openai-workflow-deserialize branch from ef71765 to 536d03d Compare May 24, 2026 15:46
Copy link
Copy Markdown

@Prana111025 Prana111025 left a comment

Choose a reason for hiding this comment

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

Delete open ai

*/
fileIdPrefixes?: readonly string[];
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Delete open ai

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

?

};
}

it('should deserialize workflow model config with url and headers', async () => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Delete

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.

[v7] WorkflowAgent: this.config.url is not a function when using openai(...) as a non-string model

2 participants