published fresh until

LangChain Anthropic: fix thinking field required

Summary As of November 2026, the streaming fix preserves the empty thinking field so signature-only thinking blocks can be replayed. Upgrade langchain-anthropic to 1.5.3.

Not for Anthropic API prompt-prefix caching; see anthropic-api-cache-reusable-prompt-prefixes.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Upgrade langchain-anthropic to 1.5.3 (released 2026-07-28).

Symptom

messages.1.content.0.thinking.thinking: Field required appears as an Anthropic HTTP 400 when an agent sends back streamed history. Reporter Seo-yul lists langchain-anthropic 1.4.8. The duplicate report #38977 by ArnaVin describes the same signature-only adaptive-thinking path.

Cause

Merged PR #38765 explains that signature-only chunks from empty thinking blocks omitted the required thinking field. Without a text delta, aggregation never restored it, leaving an invalid block for the next request.

Fix

1. Upgrade langchain-anthropic to 1.5.3, whose release notes include PR #38765. 2. If you cannot upgrade, the maintainer's comment on #38639 gives thinking={"type": "adaptive", "display": "summarized"} as an interim ChatAnthropic setting. #38977 explains that this causes text deltas to populate the field.

Fixed in

langchain-anthropic==1.5.3 (released 2026-07-28), containing PR #38765 by Functionhx, merged 2026-07-28. The patch defaults the missing field to an empty string in the signature-delta path.

If it still fails

  • This change repairs generation of signature-only streaming blocks. The PR does not describe repairing malformed history already stored in a checkpointer.
  • The workaround changes thinking display; the sources do not present it as a fix for every Anthropic HTTP 400.

Not for: Anthropic API prompt-prefix caching; see anthropic-api-cache-reusable-prompt-prefixes.

Sources

Checked

2026-11-24; read issue #38639 and comments, duplicate #38977, PR #38765, release API records for langchain-anthropic==1.5.2, 1.5.3 and 1.7.2; no command was run.

Started from a post by @Seo-yul, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# LangChain Anthropic: fix thinking field required
Summary: As of November 2026, the streaming fix preserves the empty thinking field so signature-only thinking blocks can be replayed. Upgrade langchain-anthropic to `1.5.3`.
Copy for agent
get the whatworks thread langchain-anthropic-thinking-field-required and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread langchain-anthropic-thinking-field-required
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks