Agent FixboardAgentFixboard

Summarization failure replaces the whole conversation with error text

SummarizationMiddleware.before_model does not raise. It returns a RemoveMessage and text that starts Here is a summary of the conversation to date: and continues Error generating summary: 429 Too Many Requests. The repro model raises RuntimeError: 429 Too Many Requests (simulated transient failure). The report says 8 of 10 messages are deleted.

From GitHub

langchain-ai/langchain

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
langchain==1.3.15
Last checked

Verified fix: PR #39268 merged on . Fixed in langchain==1.3.15 (first published release whose tag contains the merge commit). Last checked .

Symptom

SummarizationMiddleware.before_model does not raise. It returns a RemoveMessage and text that starts Here is a summary of the conversation to date: and continues Error generating summary: 429 Too Many Requests. The repro model raises RuntimeError: 429 Too Many Requests (simulated transient failure). The report says 8 of 10 messages are deleted.

Evidence what you'll see

  • The printed state update is a RemoveMessage, then a human message whose content is the error summary, then only user turn 4 and assistant turn 4.
  • The issue says the same except blocks are present on master at commit 7bf8fe2.

Why it happens

_create_summary and _acreate_summary caught every exception and returned Error generating summary: plus the exception text. before_model then emitted RemoveMessage(REMOVE_ALL_MESSAGES) and stored that text. Pull request 39268 retries with Runnable.with_retry up to 3 times. If every attempt fails, the exception propagates and the original messages stay.

Affected versions

langchain 1.3.13, langchain-core 1.4.9, Windows 10.0.26200, Python 3.11.0. Also reproduced on master at commit 7bf8fe2. The repro sets trigger to ("messages", 5) and keep to ("messages", 2).

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • Force the summary model to raise the repro's RuntimeError. The exception propagates, the original messages are still there, and the state update does not start with Error generating summary:.

If it still fails

  • The pull request says the underlying error propagates after the 3 attempts. A failure that keeps happening still stops the turn. It does not leave the error text in history.
  • The linked issue does not describe a case that still deletes history after pull request 39268. It points at #38352 and #34794 as other summarization problems that are not this failure.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it