unstale

npm / @langchain/anthropic

@langchain/anthropic

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

3 breaking3 security1 deprecations22 new APIs and options10 behavior and defaults26 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/anthropic 163 changes

Breaking changes 3

  • Only text, tool_addition and tool_removal blocks are sent; other blocks are dropped, and a system message with no remaining content is omitted.

    1.5.12release notes

  • The default model changes from claude-3-5-sonnet-latest to claude-sonnet-4-5-20250929.

    1.3.20release notes

  • Usage metadata input_tokens now includes cache creation and cache read tokens.

    1.2.2release notes

Security 2

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

    1.3.1security advisory

  • LangChain: RediSearch Filter Injection via Unescaped Tag/Text Values

    1.1.1security advisory

Deprecations 1

  • The output format setting moves to outputConfig.format; outputFormat remains available for backwards compatibility but is deprecated.

    1.3.15release notes

New APIs and options 22

  • Adds support for Claude Fable 5.1.

    1.5.10release notes

  • Adds support for Claude Sonnet 5.

    1.5.9release notes

  • Adds LangSmith Gateway environment configuration to Anthropic chat models.

    1.5.4release notes

  • Adds support for the claude-opus-5 model.

    1.5.2release notes

  • Adds support for strict tool calling for custom tools.

    1.4.0release notes

  • Anthropic structured output now supports standard schemas.

    1.3.22release notes

  • Anthropic raises ContextOverflowError for context overflow errors.

    1.3.18release notes

  • Adds the Claude Opus 4.6 model with 16384 default max output tokens.

    1.3.15release notes

  • Adds beta compaction support, including auto-detection of compact_20260112 edits and streaming handlers for compaction content blocks.

    1.3.15release notes

  • Adds a parameter for data residency controls.

    1.3.15release notes

  • Adds effort levels low, medium, high, and max for controlling token usage.

    1.3.15release notes

  • Supports adaptive thinking, recommended for Opus 4.6.

    1.3.15release notes

  • Exports ChatAnthropicInput, an intersection of AnthropicInput and BaseChatModelParams, for type-safe configuration and IntelliSense.

    1.3.0release notes

  • Adds a named computer use tool for use with Anthropic.

    1.3.0release notes

  • Adds a named mcp toolset tool for use with Anthropic.

    1.3.0release notes

  • Adds a named text editor tool for use with Anthropic.

    1.3.0release notes

  • Adds a named webfetch tool for use with Anthropic.

    1.3.0release notes

  • Adds support for the Anthropic tool search tool.

    1.3.0release notes

  • Adds support for advanced tool use.

    1.2.0release notes

  • Adds opus-4.5 to the supported model strings.

    1.1.3release notes

  • Support for the betas parameter was added.

    1.1.0release notes

  • Native structured output is now supported.

    1.1.0release notes

Behavior and default changes 10

  • SystemMessage content can carry tool_addition and tool_removal blocks, which are forwarded verbatim; the required beta is added automatically based on how the tool is defined.

    1.5.12release notes

  • System content built from standard content blocks no longer sends the internal block id to the provider.

    1.5.11release notes

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

    1.5.6release notes

  • Native streamEvents event coverage was updated, changing which events are covered.

    1.5.0release notes

  • Adds compatibility updates for Claude Opus 4.7, allowing developers to use the model with this package.

    1.3.27release notes

  • Adds a default max token value for Sonnet models.

    1.3.25release notes

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

    1.3.21release notes

  • Structured outputs are GA and no longer require a beta header.

    1.3.15release notes

  • Anthropic models handle standard file content blocks.

    1.3.13release notes

  • Invocation parameters now set an empty tool array.

    1.3.1release notes

Fixes and other changes 25

  • SystemMessage can appear anywhere in the message list; it applies from its position onwards, and adding one preserves the prompt cache for earlier turns.

    1.5.11release notes

  • A leading run of two or more SystemMessages is merged into the top-level system field instead of being rejected.

    1.5.11release notes

  • Preserves the generic tool search result block type in streaming output and message payload conversion, preventing INVALID_TOOL_RESULTS in multi-turn conversations after a client-tool round-trip.

    1.5.8release notes

  • Message translation now round-trips this tool search result block, preventing multi-turn requests from failing when the block is dropped.

    1.5.7release notes

  • Message translation now round-trips this tool search result block, preventing multi-turn requests from failing when the block is dropped.

    1.5.7release notes

  • A per-call maxRetries is forwarded to the retry loop, allowing a surrounding retry loop such as modelRetryMiddleware to take over instead of multiplying retry counts.

    1.5.6release notes

  • convertAnthropicStream now surfaces an Anthropic-compatible gateway's numeric usage.cost in response_metadata.usage.cost; token accounting in usage_metadata is unchanged.

    1.5.5release notes

  • Filters tools with unsupported root schema composition.

    1.5.4release notes

  • Anthropic streams preserve cost metadata provided by the gateway.

    1.5.3release notes

  • Requests no longer include thinking: { type: "disabled" } unless the user explicitly configured it, preventing default instances from failing with adaptive-only models that reject this setting.

    1.5.1release notes

  • Tool choice required is now implemented for Anthropic.

    1.3.26release notes

  • Undefined values are no longer set on the request object.

    1.3.24release notes

  • Undefined values are no longer set on the request object, and validation works when thinking is enabled.

    1.3.24release notes

  • Undefined values are no longer set on the request object, and validation works when thinking is enabled.

    1.3.24release notes

  • Prevents cache tokens from being double-counted during streaming.

    1.3.23release notes

  • Only set topP when it is defined, avoiding an API error.

    1.3.21release notes

  • When content is an empty array and tool_calls are present, formatting now appends unrepresented calls as tool_use blocks instead of silently dropping them and causing Anthropic API requests to fail.

    1.3.20release notes

  • Model profiles were updated.

    1.3.18release notes

  • Corrected the default maximum output token values for all Claude models.

    1.3.17release notes

  • Chat model invocations and streams now properly handle abort signals; invoke() throws ModelAbortError with accumulated partial output when aborted during streaming, while stream() throws AbortError.

    1.3.13release notes

  • Consolidates input_json_delta blocks in streaming tool calls, improving how streamed tool-call inputs are handled.

    1.3.11release notes

  • Fixed converting partial tool inputs.

    1.3.10release notes

  • Reasoning tokens are now properly elevated.

    1.3.8release notes

  • Fixes the .js import issue in chat_models.ts.

    1.3.0release notes

  • Fixes passing betas to the client when streaming.

    1.1.1release notes

@langchain/anthropic 0.32 changes

Security 1

Fixes and other changes 1

  • The default temperature option in v0/anthropic is fixed.

    0.3.58release notes