LangChain.js changes finish reasons and initChatModel model swapping
@langchain/core 1.5.0 renames tool_use to tool_call. langchain 1.6.7 blocks runtime model swaps unless you opt in.
Your keys
0 of 1 ready
Create each key on its own page, paste it below, then copy the finished lines into your project's .env file. Your keys stay in this tab. They are never sent to Wirestack or saved; we only count that the panel was used.
- Anthropic API keyANTHROPIC_API_KEYGet key
Click Create key, name it and pick an expiration. It starts with sk-ant-
What changed
- November 18, 2026,
langchain1.6.7.initChatModelwith a model and noconfigurableFieldsno longer letsconfigurable.modelorconfigurable.modelProviderswap the model at invoke time. The same applies tonew ConfigurableModel(...). - November 20, 2026,
@langchain/core1.5.0. TheFinishReasontype is nowstop,length,tool_call,content_filter,refusal,context_exceeded,errororother.tool_usebecametool_call. On streamed messages,response_metadata.finish_reasonnow holds the raw provider value, and the normalized value is innormalized_finish_reason. Provider packages set these fields, so core alone does not add them.MessageFinishEvent.reasonis deprecated but still sent with its old values.
Prerequisites
Steps
- If you swap models at runtime, pass
configurableFields: ["model", "modelProvider"]toinitChatModel. - Search your code for
finish_reason,tool_useandMessageFinishEvent.reason. - Read
normalized_finish_reasonwhere you branch on why a model stopped, and compare withtool_call. - Upgrade together with your provider package. For Anthropic:
npm install langchain@1.6.7 @langchain/core@1.5.0 @langchain/anthropic@1.6.6Affected by this? Start from a checked LangChain integration
Code with pinned versions, checked against the official docs on a schedule.
