Change8

langchain==1.3.0a1

📦 langchainView on GitHub →
14 features🐛 19 fixes🔧 17 symbols

Summary

This release includes numerous performance improvements, dependency bumps, and feature additions like content-block-centric streaming (v2) and integration of stream_events(version='v3'). Several bug fixes address token counting, model recognition, and middleware configuration.

Migration Steps

  1. If using custom detectors, ensure normalized output to prevent KeyErrors in hash/mask strategies (related to fix for custom detector output normalization).

✨ New Features

  • Wired stream_events(version='v3') into create_agent.
  • Introduced stream_events(version='v3') protocol in core.
  • Added `respond` decision to HITL middleware.
  • Added content-block-centric streaming (v2) in core.
  • Added `ls_agent_type` tag on `create_agent` calls.
  • Added LangSmith integration metadata to create_agent and init_chat_model.
  • Added tracing for wrap model + tool call.
  • Added support for automatic server-side compaction in openai.
  • Added `langchain-openrouter` provider package.
  • Support state updates from `wrap_model_call` with command(s).
  • Added threading context through `create_agent` flows + middleware.
  • Added `ToolCallRequest` to middleware exports.
  • Added dynamic tool registration via middleware.
  • Updated summarization prompt.

🐛 Bug Fixes

  • Fireworks: Honor `max_retries`.
  • Langchain: Update recursion limit for create_agent.
  • Infra: Correct lint_diff relative paths in package makefiles.
  • Langchain: Recognize ChatAnthropicVertex in _get_approximate_token_counter.
  • Core, model-profiles: Add missing `ModelProfile` fields, warn on schema drift.
  • Langchain, langchain-classic: Update model provider classes for Azure AI Foundry.
  • OpenAI: Add type: message to Responses API input items.
  • Langchain: Normalize custom detector output to prevent KeyError in hash/mask strategies.
  • Langchain: Support anthropic-bedrock in init_chat_model (revert of a previous change).
  • Langchain: Allow Gemini 3 models to use `ProviderStrategy` with tools.
  • Langchain: Fix token counting on partial message sequences.
  • Langchain: Bump min core version and improve approximate token counting.
  • Langchain: Avoid UnboundLocalError when no AIMessage exists.
  • Langchain: Use usage metadata scaling in SummarizationMiddleware default token counter.
  • Langchain: Reuse ToolStrategy in agent factory to prevent name mismatch.
  • Langchain: Strip trailing whitespace from the summarization prompt.
  • Langchain: Improve grammar in `SummarizationMiddleware` system prompt.
  • Langchain: `SummarizationMiddleware` signature mismatch & config invocation.
  • Langchain: Add metadata configuration to summarization model invocation.

Affected Symbols