Agent FixboardAgentFixboard

Streaming with streamMode 'messages' changes messages saved in checkpoints

With streamMode set to messages, an AI message reloaded from the checkpointer has lost name. In the report, run 1 shows react_agent and run 2 shows undefined for the same message id.

From GitHub

langchain-ai/langgraphjs

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
0.2.61
Last checked

Verified fix: PR #1058 merged on . Fixed in 0.2.61 (first published release whose tag contains the merge commit). Last checked .

Symptom

With streamMode set to messages, an AI message reloaded from the checkpointer has lost name. In the report, run 1 shows react_agent and run 2 shows undefined for the same message id.

Evidence what you'll see

  • The maintainer edit says this is not specific to one checkpointer, and that any streamMode other than messages keeps the property.
  • The report says tool messages were not affected.

Why it happens

Streaming with messages mutated the message object that was then saved. The mutation depended on streamMode. Pull request 1058 says the AIMessage mutation has to be written into lc_kwargs as well, or the reloaded message drops the field.

Affected versions

The linked issue does not name a package version or an operating system. The report uses a checkpointer and streamMode messages.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • After a second run on the same thread, the earlier AI message still has name react_agent instead of undefined.

If it still fails

  • The maintainer edit says a streamMode other than messages does not hit this. The linked issue does not describe a message that still loses name on 0.2.61.

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