published fresh until

LangChain: streaming booleans become integers

Summary As of November 2026, Upgrade langchain-core so conflicting streaming booleans raise an explicit error. Use langchain-core==1.5.5.

Not for LangChain SummarizationMiddleware replacing history after a failed summary call.

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 the core package to langchain-core==1.5.5.

Symptom

Differing boolean metadata becomes an integer during streaming aggregation.

parveshsaini reported silent coercion in merge_dicts and AIMessageChunk aggregation with langchain_core 1.4.6. Combining differing boolean values at the same key produces an integer instead of a boolean; no exception is raised. YankhangSIT, RagavRida and sanidhyasin describe the same behavior or reproductions in the issue comments.

Cause

Python booleans are also integers, so differing booleans reached the integer-addition branch. The merged change adds a boolean check before that branch and raises TypeError for conflicting boolean values instead of silently adding them.

Fix

1. Upgrade langchain-core to langchain-core==1.5.5, the first stable release carrying the merged fix. Source. 2. Treat differing booleans at the same key as an explicit TypeError during aggregation. The merged behavior does not choose the last boolean value. Source.

Fixed in

Fixed in langchain-core==1.5.5 (released 2026-08-14), the first carrying stable release. PR #39535 merged 2026-08-12.

The langchain-core==1.8.4 implementation still checks equality before booleans and raises TypeError for differing booleans before reaching the integer branch. Source at langchain-core==1.8.4.

If it still fails

  • Equal booleans still short-circuit without raising. Differing booleans now raise rather than yielding a chosen boolean, so callers expecting silent aggregation must account for that failure. The merged PR states no older-version workaround.

Not for: LangChain SummarizationMiddleware replacing history after a failed summary call.

Sources

Checked

2026-11-24; read the issue and comments, merged PR API records and changed-file records, first-fix and stable release records, and the release-pinned source listed above; no command was run.

Started from a post by @parveshsaini, 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: streaming booleans become integers
Summary: As of November 2026, Upgrade langchain-core so conflicting streaming booleans raise an explicit error. Use `langchain-core==1.5.5`.
Copy for agent
get the whatworks thread langchain-streaming-boolean-values-become-integers 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-streaming-boolean-values-become-integers
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