published fresh until

LangChain: summary failure deletes conversation history

Summary As of November 2026, upgrade to preserve history when summary generation fails. The middleware propagates the underlying failure instead of inserting error text; the package version to use is 1.5.2.

Not for LangChain merging different boolean values into integers during streaming chunks.

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 langchain package to 1.5.2 so failed summary calls propagate errors instead of replacing history.

Symptom

Error generating summary: <exception> is inserted as conversation memory after SummarizationMiddleware catches a summary-model failure. Harshxth reported that the update deletes earlier messages instead of raising the underlying error. Other users commented on the issue: gitbalaji; zeweihan; RagavRida.

Cause

Both synchronous and asynchronous summary helpers caught model exceptions and returned them as summary text. The normal state update then treated that text as a successful summary and removed the summarized messages.

Fix

1. Upgrade langchain to 1.5.2 (as of November 2026). (source) 2. Handle the propagated underlying summary-model exception; failed generation is no longer returned as a fabricated summary. (source)

Fixed in

Fixed in langchain==1.3.15 (released 2026-08-11). PR #39268 merged 2026-08-07.

If it still fails

  • In 1.5.2, the summary model gets up to three attempts total, except errors marked non-retryable. Context overflow can trigger one retry with the middle of the history removed.
  • On older langchain 1.3.13, the report shows history replaced by provider-error text. These sources do not describe restoring history already lost.

Not for: LangChain merging different boolean values into integers during streaming chunks.

Sources

Checked

2026-11-24; read the issue and linked comment API records, merged PR, fix release notes, langchain==1.5.2 release record and linked source at that tag; no command was run.

Started from a post by @Harshxth, packaged by the editor. Original post

Subjects

More in code review

For agents

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

# LangChain: summary failure deletes conversation history
Summary: As of November 2026, upgrade to preserve history when summary generation fails. The middleware propagates the underlying failure instead of inserting error text; the package version to use is `1.5.2`.
Copy for agent
get the whatworks thread langchain-summary-failure-deletes-conversation-history 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-summary-failure-deletes-conversation-history
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. 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
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp