[PR #1480] [MERGED] fix(langgraph): handle empty messages #1490

Closed
opened 2026-02-15 20:15:57 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/1480
Author: @yt20chill
Created: 8/1/2025
Status: Merged
Merged: 8/1/2025
Merged by: @dqbd

Base: mainHead: ToolNode


📝 Commits (3)

📊 Changes

2 files changed (+6 additions, -0 deletions)

View changed files

.changeset/smooth-dragons-drive.md (+5 -0)
📝 libs/langgraph/src/prebuilt/tool_node.ts (+1 -0)

📄 Description

Gracefully handle empty messages when deciding conditional mapping to "tools" or END

If messages is empty, message is assigned to undefined, and "tool_calls" in message will throw.


🔄 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/1480 **Author:** [@yt20chill](https://github.com/yt20chill) **Created:** 8/1/2025 **Status:** ✅ Merged **Merged:** 8/1/2025 **Merged by:** [@dqbd](https://github.com/dqbd) **Base:** `main` ← **Head:** `ToolNode` --- ### 📝 Commits (3) - [`17a2411`](https://github.com/langchain-ai/langgraphjs/commit/17a241124875973de32cd5a4efac1129a9f055f0) Fix: handle empty messages - [`73975ed`](https://github.com/langchain-ai/langgraphjs/commit/73975ed28538e328ba50e0714488b943d9d23eb5) Add changeset - [`faa80aa`](https://github.com/langchain-ai/langgraphjs/commit/faa80aa3920bfc8916520e8c35255e44e09de614) Fix formatting ### 📊 Changes **2 files changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/smooth-dragons-drive.md` (+5 -0) 📝 `libs/langgraph/src/prebuilt/tool_node.ts` (+1 -0) </details> ### 📄 Description Gracefully handle empty messages when deciding conditional mapping to "tools" or END If messages is empty, message is assigned to `undefined`, and "tool_calls" in message will throw. --- <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 20:15:57 -05:00
yindo closed this issue 2026-02-15 20:15:57 -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#1490