Skip to content

Conversation

@christian-bromann
Copy link
Member

backported from #8873

…unctionality

The disableStreaming property was not correctly handling undefined values, causing
streaming to break when fields.disableStreaming was explicitly or implicitly undefined.
This occurred because the nullish coalescing operator (??) would preserve undefined
instead of falling back to the default false value from the parent class.

Changed the initialization to use strict boolean check (=== true) which ensures:
- undefined/null/falsy values → false (preserves default behavior)
- explicit true → true (disables streaming as intended)
- type safety by always resulting in a boolean value

This fixes the regression introduced in v0.6.10 where streaming stopped working.

- Updated disableStreaming initialization in BaseChatOpenAI constructor
- Added comprehensive unit tests for various input scenarios
@changeset-bot
Copy link

changeset-bot bot commented Sep 8, 2025

🦋 Changeset detected

Latest commit: 7a18610

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@langchain/openai Patch

Not sure what this means? Click here to learn what changesets are.

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

@vercel
Copy link

vercel bot commented Sep 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
langchainjs-docs Ready Ready Preview Comment Sep 8, 2025 7:33pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
langchainjs-api-refs Ignored Ignored Sep 8, 2025 7:33pm

@christian-bromann christian-bromann changed the title fix(openai/0.c): handle undefined disableStreaming to restore streaming functionality fix(openai/0.x): handle undefined disableStreaming to restore streaming functionality Sep 8, 2025
@christian-bromann christian-bromann merged commit 707a768 into main Sep 9, 2025
42 of 43 checks passed
@christian-bromann christian-bromann deleted the cb/fix-openai-streaming-0.x branch September 9, 2025 17:54
hntrl added a commit that referenced this pull request Oct 14, 2025
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.

3 participants