Skip to content

reproduction: WorkflowAgent.stream: Output.object responseFormat is dropped in doStreamStep —#16996

Draft
lgrammel wants to merge 1 commit into
mainfrom
bug-16565-1
Draft

reproduction: WorkflowAgent.stream: Output.object responseFormat is dropped in doStreamStep —#16996
lgrammel wants to merge 1 commit into
mainfrom
bug-16565-1

Conversation

@lgrammel

@lgrammel lgrammel commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Bug

WorkflowAgent.stream(): Output.object responseFormat is dropped in doStreamStep — structured output never enforced

Reproduction

  • Classified as general @ai-sdk/workflow library behavior; no external provider API assumptions were required.
  • Created reproduction script at examples/ai-functions/src/reproduction/issue-16565-workflow-response-format.ts.
  • The script configures WorkflowAgent with Output.object({ schema }) and a mock model that only returns valid JSON when it receives responseFormat.type === 'json'.
  • Observed WorkflowAgent.stream() sends the mock model responseFormat: null, causing the model to return prose and structured output parsing to fail with AI_NoObjectGeneratedError.
  • Expected WorkflowAgent.stream() to forward the JSON response format and return output { ok: true }.

Related Issues

Reproduces #16565

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants