[PR #846] [MERGED] fix(langgraph): Dedupe input (right-side) messages in messageStateReducer #1059

Closed
opened 2026-02-15 19:17:01 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/846
Author: @jacoblee93
Created: 2/6/2025
Status: Merged
Merged: 2/6/2025
Merged by: @jacoblee93

Base: mainHead: jacob/reducer


📝 Commits (1)

  • 109511b Dedupe right side messages in messageStateReducer

📊 Changes

2 files changed (+25 additions, -1 deletions)

View changed files

📝 libs/langgraph/src/graph/message.ts (+4 -1)
📝 libs/langgraph/src/tests/prebuilt.test.ts (+21 -0)

📄 Description

There are some cases where duplicate messages (with the same id) can accumulate in a result in before they are returned by a node and passed into a reducer

This change dedupes in new messages

FYI @benjamincburns @nfcampos


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langgraphjs/pull/846 **Author:** [@jacoblee93](https://github.com/jacoblee93) **Created:** 2/6/2025 **Status:** ✅ Merged **Merged:** 2/6/2025 **Merged by:** [@jacoblee93](https://github.com/jacoblee93) **Base:** `main` ← **Head:** `jacob/reducer` --- ### 📝 Commits (1) - [`109511b`](https://github.com/langchain-ai/langgraphjs/commit/109511b5844da7ff455ba23883592fdfcc62013e) Dedupe right side messages in messageStateReducer ### 📊 Changes **2 files changed** (+25 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `libs/langgraph/src/graph/message.ts` (+4 -1) 📝 `libs/langgraph/src/tests/prebuilt.test.ts` (+21 -0) </details> ### 📄 Description There are some cases where duplicate messages (with the same id) can accumulate in a result in before they are returned by a node and passed into a reducer This change dedupes in new messages FYI @benjamincburns @nfcampos --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 19:17:01 -05:00
yindo closed this issue 2026-02-15 19:17:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#1059