unstale

npm / @langchain/openai

@langchain/openai

What changed in @langchain/openai 0.3 to 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.

2 breaking3 security31 new APIs and options1 performance10 behavior and defaults42 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

@langchain/openai 188 changes

Breaking changes 2

  • Applies per-call options before modelKwargs, then the constructor field; on Chat Completions, modelKwargs values are no longer dropped and take precedence over the constructor field.

    1.6.0release notes

  • Applies per-call options before modelKwargs, then the constructor field; on Chat Completions, modelKwargs values are no longer dropped and take precedence over the constructor field.

    1.6.0release notes

Security 2

  • LangChain: MongoDBChatMessageHistory query injection can allow cross-session access

    1.3.1security advisory

  • Encrypted reasoning is now included in the input for zero-data-retention (ZDR) responses.

    1.2.5release notes

New APIs and options 31

  • Responses API accepts an additional_tools block on a SystemMessage and sends it as a top-level input item preceding the message. It throws if used with Chat Completions or on a non-SystemMessage, except assistant messages.

    1.6.2release notes

  • ModelProfile now includes fileMimeTypes so models can advertise accepted MIME types for generic file inputs; OpenAI Responses API models report the types supported by input_file.

    1.6.1release notes

  • Adds support for content-block breakpoints.

    1.6.0release notes

  • Supports explicit prompt cache options.

    1.6.0release notes

  • Supports configuration_update content blocks for changing reasoning effort mid-conversation without invalidating the cached prompt prefix.

    1.5.12release notes

  • OpenAI chat models can now use LangSmith Gateway environment configuration.

    1.5.6release notes

  • Adds native event converters for streamEvents.

    1.5.0release notes

  • Responses API messages now support phase on text content blocks, including streaming events, and round-trip it through raw provider and standard content paths.

    1.4.0release notes

  • Propagates defer_loading from LangChain tool extras through bindTools() into the Responses API payload, enabling on-demand tool discovery.

    1.3.0release notes

  • Adds a factory for the OpenAI Responses API tool_search built-in tool, supporting server-executed and client-executed modes.

    1.3.0release notes

  • Added gpt-5.4 to profiles, making it available to developers using the package.

    1.2.13release notes

  • Structured output now supports Standard Schema, allowing developers to use Standard Schema schemas for structured output.

    1.2.12release notes

  • File input conversion supports docx, pptx, xlsx, and csv document types.

    1.2.11release notes

  • OpenAI now raises ContextOverflowError for context overflow, giving callers a specific error to handle.

    1.2.8release notes

  • Adds support for codex 5.3.

    1.2.5release notes

  • The image generation tool accepts an action option with generate, edit, and auto choices.

    1.2.5release notes

  • Adds local_shell_call support to the streaming converter and input reconstruction.

    1.2.5release notes

  • Adds shell_call support to the streaming converter and input reconstruction.

    1.2.5release notes

  • Adds a deprecated call-option shorthand for reasoning.effort; reasoning.effort takes precedence when both are provided.

    1.2.4release notes

  • Adds support for the apply patch tool.

    1.2.0release notes

  • Adds support for the code interpreter tool.

    1.2.0release notes

  • Adds support for the computer use tool.

    1.2.0release notes

  • Adds support for the file search tool.

    1.2.0release notes

  • Adds support for the image generation tool.

    1.2.0release notes

  • Adds support for the local shell tool.

    1.2.0release notes

  • Adds support for the MCP connector tool.

    1.2.0release notes

  • Adds moderateContent to ChatOpenAI for content moderation.

    1.2.0release notes

  • Adds support for prompt cache retention.

    1.2.0release notes

  • Adds support for the shell tool.

    1.2.0release notes

  • Adds support for the web search tool.

    1.2.0release notes

  • apiKey now supports a callable function.

    1.1.2release notes

Performance 1

  • Stream chunk aggregation was optimized and redundant sorting was removed.

    1.2.3release notes

Behavior and default changes 10

  • The v0 default replay path reuses response_metadata.output directly, preserving every reasoning item's id and encrypted_content in original order under Zero Data Retention.

    1.5.13release notes

  • Timeouts and rate limits are marked retryable; aborts, context overflow, invalid tool results, bad credentials, and unknown models are marked non-retryable. Other errors remain unmarked and retry as before.

    1.5.8release notes

  • Strict tools are decoupled from strict structured output responses, so their behavior is no longer tied together.

    1.5.3release notes

  • Built-in tool progress events are now streamed.

    1.5.2release notes

  • Standard URL file blocks are now routed to native input_file in the Responses API.

    1.5.2release notes

  • Runnable traces now include package version metadata, making version information available in LangSmith trace metadata.

    1.2.11release notes

  • Stores response.output in response_metadata to support reasoning model round-trips.

    1.2.7release notes

  • Codex models, including codex-mini-latest and gpt-5-codex variants, are automatically routed to the Responses API.

    1.2.5release notes

  • OpenAI image generation outputs are now returned as proper image content blocks.

    1.2.3release notes

  • Prefers the Responses API for 5.2 pro.

    1.2.0release notes

Fixes and other changes 42

  • Wrapped configuration_update and mcp_approval_response blocks are now hoisted as Responses API input items, including blocks on messages built with contentBlocks. Chat Completions sends a non_standard block's payload rather than its wrapper.

    1.6.2release notes

  • Sends the in-memory retention value as in_memory because the API rejects the hyphenated value.

    1.6.0release notes

  • The v1 contentBlocks replay path preserves every reasoning item's id and encrypted_content in original order under Zero Data Retention.

    1.5.13release notes

  • Fixes base URL deserialization.

    1.5.12release notes

  • Routes gpt-5.6-sol to the Responses API so function tools work with reasoning.

    1.5.12release notes

  • Streaming now resolves encrypted_content from the canonical payload on the final done event, and it propagates without needing an include call option.

    1.5.11release notes

  • Tool-call-only v1 assistant messages now send content as null instead of an empty array.

    1.5.10release notes

  • OpenAI cache_write_tokens are mapped to cache_creation in usage_metadata.input_token_details instead of being silently dropped.

    1.5.9release notes

  • Gemini-native functionCall content blocks are dropped when converting messages to Chat Completions API params, preventing requests from failing during cross-provider handoffs.

    1.5.9release notes

  • A per-call maxRetries is forwarded to the retry loop so a surrounding retry loop can take over instead of multiplying retries.

    1.5.8release notes

  • Includes usage in response_metadata when system_fingerprint is absent.

    1.5.7release notes

  • Content blocks rejected by the chat completions API are filtered out of input.

    1.5.5release notes

  • tool_call content blocks are dropped from chat completions input.

    1.5.5release notes

  • Assistant content in responses input now emits output_text.

    1.5.4release notes

  • The converter no longer forwards content on reasoning input items, which only carry summary, avoiding a Responses API error.

    1.5.2release notes

  • When replaying reasoning items as Responses API input, the converter now omits id when it is absent, avoiding an OpenAI 400 error.

    1.5.2release notes

  • Responses API stream iteration errors are now wrapped with existing OpenAI client error handling.

    1.5.1release notes

  • AI messages preserve top-level Responses API ids.

    1.4.7release notes

  • Custom tool calls are streamed through Responses API chunks.

    1.4.7release notes

  • Handles JSON parsing failures caused by trailing non-whitespace characters without terminating the streaming response; the structured-output pipeline handles the typed failure.

    1.4.6release notes

  • Preserves v1 assistant tool calls.

    1.4.6release notes

  • Adds an index to streaming reasoning content blocks so chunks merge properly.

    1.4.4release notes

  • Preserves plain string responses content.

    1.4.3release notes

  • Placeholder filenames are supplied for OpenAI file inputs.

    1.4.2release notes

  • Preserves reasoning_content in ChatOpenAICompletions.

    1.4.1release notes

  • DeepSeek 400 errors containing maximum context length are now recognized as ContextOverflowError, allowing downstream code to handle context overflow correctly.

    1.3.1release notes

  • Guard JSON.parse in streaming json_schema when the text is empty.

    1.3.1release notes

  • Streaming and non-streaming converters handle tool_search_call and tool_search_output response items; core block translation maps them to server_tool_call and server_tool_call_result.

    1.3.0release notes

  • Fixes type narrowing for the new union type.

    1.2.11release notes

  • The Completions API streaming path now calls the callback for the final usage chunk, so callback-based consumers receive the usage_metadata chunk.

    1.2.10release notes

  • Passes service_tier to the API when using the Responses API.

    1.2.7release notes

  • Chat model invoke and streaming operations now check and propagate abort signals, enabling cancellation and allowing fallback chains to proceed after an abort.

    1.2.4release notes

  • Validation now allows file_url and file_id without filename metadata and avoids sending filename when it is not allowed.

    1.2.4release notes

  • ChatOpenAI now passes runManager to responses._generate.

    1.2.4release notes

  • A fix was made to OpenAI reasoning.

    1.2.3release notes

  • Reasoning tokens are now properly elevated.

    1.2.2release notes

  • The responses API now passes runManager to _streamResponseChunks.

    1.2.1release notes

  • Provider-native content in ToolMessage is passed through without stringification, preserving its original form.

    1.2.1release notes

  • Fixes content in AIMessage for tool and function calls.

    1.2.0release notes

  • Fixes filename and base64 conversions in OpenAI completions converters.

    1.2.0release notes

  • Allows setting the strict tag manually in providerStrategy.

    1.2.0release notes

  • Fix missing and inconsistent user agent headers.

    1.1.2release notes

@langchain/openai 0.31 changes

Security 1