Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: langchain-ai/langchain
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: langchain==1.3.17
Choose a base ref
...
head repository: langchain-ai/langchain
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: langchain==1.3.18
Choose a head ref
  • 14 commits
  • 35 files changed
  • 11 contributors

Commits on Aug 25, 2026

  1. chore(model-profiles): refresh model profile data (#39906)

    Automated refresh of model profile data for all in-monorepo partner
    integrations via `langchain-profiles refresh`.
    
    🤖 Generated by the [`refresh_model_profiles`
    workflow](https://github.com/langchain-ai/langchain/blob/master/.github/workflows/refresh_model_profiles.yml).
    
    ## Summary of changes
    
    **3 added · 8 removed · 6 changed** across 2 provider(s).
    
    <details>
    <summary>deepseek</summary>
    
    **➖ 2 removed**
    - `deepseek-chat`
    - `deepseek-reasoner`
    
    </details>
    
    <details>
    <summary>openrouter</summary>
    
    **➕ 3 added**
    - `minimax/minimax-m2.7:free` — 196,608 ctx, 196,608 out, reasoning,
    tools
    - `minimax/minimax-m3:free` — 1,048,576 ctx, 1,048,576 out,
    text+image+video in, reasoning, tools
    - `mistralai/devstral-2512` — 262,144 ctx, 262,144 out, text+pdf in,
    tools
    
    **➖ 6 removed**
    - `inclusionai/ling-2.6-1t`
    - `inclusionai/ling-2.6-flash`
    - `inclusionai/ring-2.6-1t`
    - `nvidia/nemotron-3-nano-30b-a3b:free`
    - `nvidia/nemotron-nano-12b-v2-vl:free`
    - `nvidia/nemotron-nano-9b-v2:free`
    
    **✏️ 6 changed**
    - `qwen/qwen3-235b-a22b-thinking-2507`: max input tokens 262,144 →
    131,072
    - `thinkingmachines/inkling-small:free`: max input tokens 262,144 →
    1,048,576
    - `thinkingmachines/inkling:free`: max input tokens 262,144 → 1,048,576
    - `z-ai/glm-5.1`: max output tokens 128,000 → 202,752
    - `z-ai/glm-5.2`: max output tokens 131,072 → 262,144
    - `~moonshotai/kimi-latest`: max output tokens 974,842 → 1,048,576
    
    </details>
    
    ---------
    
    Co-authored-by: mdrxy <[email protected]>
    Co-authored-by: Mason Daugherty <[email protected]>
    3 people authored Aug 25, 2026
    Configuration menu
    Copy the full SHA
    43bed06 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2026

  1. fix(anthropic): auto-append advisor-tool-2026-03-01 beta header for…

    … `advisor_20260301` tool (#39917)
    
    Co-authored-by: DarRahman <[email protected]>
    DarRahman and DarRahman authored Aug 26, 2026
    Configuration menu
    Copy the full SHA
    7f5b324 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c9dcf6e View commit details
    Browse the repository at this point in the history
  3. chore(model-profiles): refresh model profile data (#39928)

    Automated refresh of model profile data for all in-monorepo partner
    integrations via `langchain-profiles refresh`.
    
    🤖 Generated by the [`refresh_model_profiles`
    workflow](https://github.com/langchain-ai/langchain/blob/master/.github/workflows/refresh_model_profiles.yml).
    
    ## Summary of changes
    
    **1 added · 2 removed · 102 changed** across 2 provider(s).
    
    <details>
    <summary>huggingface</summary>
    
    **➕ 1 added**
    - `Qwen/Qwen3.8-27B` — 262,144 ctx, 32,768 out, text+image in,
    reasoning, tools
    
    </details>
    
    <details>
    <summary>openrouter</summary>
    
    **➖ 2 removed**
    - `google/gemma-3n-e4b-it`
    - `qwen/qwen-plus-2025-07-28:thinking`
    
    **✏️ 102 changed**
    - `aion-labs/aion-rp-llama-3.1-8b`: max output tokens 32,768 → 29,491
    - `allenai/olmo-3-32b-think`: max output tokens 65,536 → 58,982
    - `arcee-ai/trinity-large-thinking`: max output tokens 262,144 → 235,929
    - `bytedance-seed/seed-2-1-turbo`: max output tokens 262,144 → 235,929
    - `deepseek/deepseek-chat-v3-0324`: max output tokens 163,840 → 147,456
    - `deepseek/deepseek-chat-v3.1`: max output tokens 161,000 → 144,900
    - `deepseek/deepseek-r1-distill-llama-70b`: max output tokens 8,192 →
    7,372
    - `deepseek/deepseek-v3.2`: max output tokens 163,840 → 147,456
    - `deepseek/deepseek-v4-flash-0731`: max output tokens 131,072 → 943,718
    - `deepseek/deepseek-v4-pro-0813`: max output tokens 384,000 → 943,717
    - `dots-studio/dots-3-note-preview:free`: max output tokens 512,000 →
    460,800
    - `google/gemini-3.1-flash-image-preview`: max output tokens 65,536 →
    58,982
    - `google/gemini-3.1-flash-lite-image`: max output tokens 65,536 →
    58,982
    - `google/gemma-3-27b-it`: max output tokens 131,072 → 117,964
    - `google/gemma-4-31b-it`: max output tokens 262,144 → 16,384
    - `gryphe/mythomax-l2-13b`: max output tokens 4,096 → 3,686
    - `ibm-granite/granite-4.0-h-micro`: max output tokens 131,000 → 117,900
    - `ibm-granite/granite-4.1-8b`: max output tokens 131,072 → 117,964
    - `meta-llama/llama-3.1-8b-instruct`: max output tokens 131,072 →
    117,964
    - `meta-llama/llama-3.2-1b-instruct`: max output tokens 60,000 → 54,000
    - `meta-llama/llama-3.2-3b-instruct`: max output tokens 131,072 →
    117,964
    - `meta-llama/llama-3.3-70b-instruct`: max output tokens 16,384 →
    115,200
    - `meta-llama/llama-4-scout`: max output tokens 16,384 → 8,192
    - `meta-llama/llama-guard-4-12b`: max input tokens 1,048,576 → 163,840
    - `meta/muse-glimmer-30b`: max output tokens 131,072 → 117,964
    - …and 77 more
    
    </details>
    
    Co-authored-by: mdrxy <[email protected]>
    langchain-oss-model-profiles[bot] and mdrxy authored Aug 26, 2026
    Configuration menu
    Copy the full SHA
    502b2b4 View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2026

  1. Configuration menu
    Copy the full SHA
    b0fb33f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fd2fbd7 View commit details
    Browse the repository at this point in the history
  3. chore(model-profiles): refresh model profile data (#39954)

    Automated refresh of model profile data for all in-monorepo partner
    integrations via `langchain-profiles refresh`.
    
    🤖 Generated by the [`refresh_model_profiles`
    workflow](https://github.com/langchain-ai/langchain/blob/master/.github/workflows/refresh_model_profiles.yml).
    
    ## Summary of changes
    
    **4 added · 1 removed · 12 changed** across 4 provider(s).
    
    <details>
    <summary>huggingface</summary>
    
    **➕ 1 added**
    - `zai-org/GLM-5.3-Flash` — 1,048,576 ctx, 131,072 out, reasoning, tools
    
    **✏️ 2 changed**
    - `MiniMaxAI/MiniMax-M2`: max output tokens 128,000 → 131,072
    - `MiniMaxAI/MiniMax-M3`: max output tokens 128,000 → 512,000
    
    </details>
    
    <details>
    <summary>mistral</summary>
    
    **➕ 1 added**
    - `zai-glm-5-2` — 1,000,000 ctx, 131,072 out, reasoning, tools
    
    </details>
    
    <details>
    <summary>openai</summary>
    
    **✏️ 6 changed**
    - `gpt-5.1`: added temperature control
    - `gpt-5.2`: added temperature control
    - `gpt-5.3-codex`: added temperature control
    - `gpt-5.4`: added temperature control
    - `gpt-5.4-mini`: added temperature control
    - `gpt-5.4-nano`: added temperature control
    
    </details>
    
    <details>
    <summary>openrouter</summary>
    
    **➕ 2 added**
    - `qwen/qwen3.8-flash` — 1,000,000 ctx, 131,072 out, text+image+video
    in, reasoning, tools
    - `z-ai/glm-5.3-flash` — 1,310,720 ctx, 131,072 out, text+image+video
    in, reasoning, tools
    
    **➖ 1 removed**
    - `stealth/ox-alpha`
    
    **✏️ 4 changed**
    - `nvidia/nemotron-3-nano-30b-a3b`: max output tokens 235,929 → 228,000
    - `qwen/qwen3-235b-a22b-2507`: max output tokens 16,384 → 235,929
    - `qwen/qwen3.6-27b`: max output tokens 235,929 → 81,920
    - `z-ai/glm-4.6`: max output tokens 131,072 → 16,384
    
    </details>
    
    Co-authored-by: mdrxy <[email protected]>
    langchain-oss-model-profiles[bot] and mdrxy authored Aug 27, 2026
    Configuration menu
    Copy the full SHA
    513e425 View commit details
    Browse the repository at this point in the history
  4. fix(openai): correct reasoning_effort_levels for gpt-5 and gpt-5.1 …

    …profiles (#39936)
    
    Fixes #39935
    
    ---
    
    `gpt-5`, `gpt-5-mini`, `gpt-5-nano` and `gpt-5.1` no longer advertise a
    reasoning effort level they reject, and the GPT-5 models advertise
    `minimal` again.
    
    The profile augmentations currently give all four models `["none",
    "low", "medium", "high", "xhigh"]`. OpenAI's [GPT-5 model
    page](https://developers.openai.com/api/docs/models/gpt-5) states that
    effort supports "minimal, low, medium, and high", and the [GPT-5.1
    page](https://developers.openai.com/api/docs/models/gpt-5.1) lists "none
    (default), low, medium, and high". `xhigh` arrived later, with
    GPT-5.1-Codex-Max.
    
    A client that reads `profile["reasoning_effort_levels"]` to build its
    settings therefore offers `xhigh` on models that reject it, and hides
    `minimal`, which GPT-5 accepts. The corrected values match the
    models.dev entries for the same models.
    
    The `gpt-5.2` / `gpt-5.4` / `gpt-5.6` profiles are already correct and
    are untouched. A few other entries (`gpt-5-pro`, `gpt-5.2-pro`,
    `gpt-5.4-pro`, `gpt-5.2-chat-latest`) also differ from models.dev, but I
    could not confirm those from OpenAI's own docs, so I left them alone.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    ---------
    
    Co-authored-by: Mason Daugherty <[email protected]>
    Dejwwik and mdrxy authored Aug 27, 2026
    Configuration menu
    Copy the full SHA
    c253f54 View commit details
    Browse the repository at this point in the history
  5. feat(anthropic): support top-level param for skills via container; …

    …`updates` thinking display mode (#39962)
    ccurme authored Aug 27, 2026
    Configuration menu
    Copy the full SHA
    e3f6adf View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3b3b308 View commit details
    Browse the repository at this point in the history
  7. fix(core): make StructuredTool JSON-serializable (#39631)

    ## Problem
    
    `StructuredTool` cannot be dumped to JSON:
    
    ```python
    @tool
    def write_file(file_path: str, content: str) -> str:
        """Write content to the given path."""
        return "ok"
    
    write_file.model_dump(mode="json")
    # PydanticSerializationError: Unable to serialize unknown type:
    #   <class 'pydantic._internal._model_construction.ModelMetaclass'>
    ```
    
    `args_schema` holds a Pydantic model class, and `func` / `coroutine`
    hold callables. None of them have a JSON form. Python-mode
    `model_dump()` works; only the JSON modes raise.
    
    This also costs tracing performance. The [LangSmith
    SDK](https://github.com/langchain-ai/langsmith-sdk/blob/main/python/langsmith/_internal/_serde.py)
    catches the error, dumps again in Python mode, and then sends every
    class and function left in the result through its own `default` hook.
    
    ## Change
    
    A `PlainSerializer(..., when_used="json-unless-none")` on the three
    fields.
    
    - `args_schema` dumps as its own JSON schema: `model_json_schema()` for
    a Pydantic v2 class, `schema()` for a v1 one. A dict schema passes
    through unchanged. A schema holding an arbitrary type has no JSON schema
    at all, so it falls back to its repr instead of raising.
    - `func` and `coroutine` dump as strings.
    - Python-mode dumps are unchanged — still the live schema class and
    callables.
    - `exclude` / `include` / `exclude_none` keep working.
    - Attached with `Annotated`, not `@field_serializer`. A field has only
    one serializer slot, so `@field_serializer` would break any subclass
    that declares its own serializer for the same field.
    - Schema generation is cached per class. Pydantic does not memoize it,
    and tracing would pay for it on every run.
    
    ## Result
    
    The dump is JSON-native, and the schema it carries has the same shape a
    dict `args_schema` already has, so it validates back into a working
    tool.
    
    Measured on the 8 filesystem tools of a deepagents agent, dumped through
    the LangSmith serializer:
    
    | | master | this PR |
    |---|---|---|
    | time per dump | 0.119 ms | **0.025 ms** |
    | payload | 7,706 B | 12,213 B |
    | objects reaching the SDK's `default` hook | 32 | 8 |
    
    The payload grows because `args_schema` now carries the real schema
    instead of `"<class ...>"`. Only the tool itself still enters the
    `default` hook; the class and functions inside it no longer do. Without
    the per-class cache the same dump takes 1.10 ms, so the cache is what
    makes this a win rather than a regression.
    
    ## Why not on `BaseTool`
    
    `args_schema` is declared there as well, so `Tool` and custom subclasses
    hit the same error. But an `Annotated` serializer only applies where the
    field is declared, and `StructuredTool` redeclares `args_schema` — it
    would not inherit one from `BaseTool`.
    
    ## Tests
    
    In `libs/core/tests/unit_tests/test_tools.py`: JSON round trip, Python
    mode unchanged, dump options respected, dict `args_schema` preserved,
    Pydantic v1 schema class, arbitrary-type fallback, and a subclass
    declaring its own serializers for the same fields.
    emil-lc authored Aug 27, 2026
    Configuration menu
    Copy the full SHA
    13b1b2f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    38e2113 View commit details
    Browse the repository at this point in the history
  9. fix(langchain): preserve content-block shape in PIIMiddleware redacti…

    …on (#39894)
    
    `PIIMiddleware` redacted message content via `str(message.content)`.
    When `.content` is a list of content blocks rather than a plain string,
    `str(...)` produces the `repr` of the list — so a redacted user message
    was stored as the literal string:
    
    ```
    "[{'type': 'text', 'text': 'my email is [REDACTED_EMAIL]'}]"
    ```
    
    The PII itself was still detected and redacted; only the shape of the
    message was destroyed. Anyone sending multimodal or provider-native
    block content through an agent with `PIIMiddleware` had their messages
    silently flattened into that repr before reaching the model.
    
    `_process_content` now accepts either shape and walks content blocks,
    redacting the text of each block in place and leaving non-text blocks
    untouched. Plain-string content behaves exactly as before.
    
    While fixing the call sites, this also drops the hand-rebuilding of
    messages (`HumanMessage(content=..., id=..., name=...)`) in favor of
    `model_copy`. The enumerated rebuild had been quietly discarding every
    field it did not list — `additional_kwargs`, `response_metadata`, and so
    on — on any message that contained PII.
    
    ## Release note
    
    Fixed `PIIMiddleware` flattening list-of-content-blocks message content
    into its string `repr` during redaction. Redaction now preserves the
    original content shape, and no longer drops message fields such as
    `additional_kwargs` on redacted messages.
    
    ---
    
    *Written with the help of an AI agent (Claude Code).*
    sydney-runkle authored Aug 27, 2026
    Configuration menu
    Copy the full SHA
    4a66e35 View commit details
    Browse the repository at this point in the history
  10. release(langchain): 1.3.18 (#39966)

    Patch bump of `langchain` from 1.3.17 to 1.3.18 to prepare a release.
    
    Picks up the `PIIMiddleware` redaction fix (#39894): message content
    that is a list of content blocks was being flattened into the string
    `repr` of the list during redaction, and redacted messages were losing
    fields such as `additional_kwargs`.
    
    Standard three-file bump — `__version__`, `pyproject.toml`, and the
    `langchain` entry in `uv.lock`. Running `uv lock` locally also pulled in
    unrelated dependency drift (upstream specifier changes and
    environment-dependent marker lines), so that churn was reverted and only
    the version line kept, matching prior release PRs.
    
    ---
    
    *Written with the help of an AI agent (Claude Code).*
    sydney-runkle authored Aug 27, 2026
    Configuration menu
    Copy the full SHA
    7d4b42b View commit details
    Browse the repository at this point in the history
Loading