[PR #1340] [MERGED] fix(langgraph): avoid calling _emit for runs without metadata #1388

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/1340
Author: @dqbd
Created: 7/3/2025
Status: Merged
Merged: 7/4/2025
Merged by: @dqbd

Base: mainHead: dqbd/stream-messages-metadata


📝 Commits (3)

  • fb4fbbb fix(langgraph): avoid calling _emit for runs without metadata
  • 72bfdc5 Add test
  • 9ec180e Update types to permit undefined

📊 Changes

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

View changed files

📝 libs/langgraph/src/pregel/messages.test.ts (+25 -0)
📝 libs/langgraph/src/pregel/messages.ts (+4 -1)

📄 Description

When tags: ["nostream"] is passed to the LLM model, the metadata is not set at all, thus handleLLMEnd will emit an exception.


🔄 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/1340 **Author:** [@dqbd](https://github.com/dqbd) **Created:** 7/3/2025 **Status:** ✅ Merged **Merged:** 7/4/2025 **Merged by:** [@dqbd](https://github.com/dqbd) **Base:** `main` ← **Head:** `dqbd/stream-messages-metadata` --- ### 📝 Commits (3) - [`fb4fbbb`](https://github.com/langchain-ai/langgraphjs/commit/fb4fbbb2a29aa9b87c300bf13cbd6be40b9900cc) fix(langgraph): avoid calling _emit for runs without metadata - [`72bfdc5`](https://github.com/langchain-ai/langgraphjs/commit/72bfdc5a5ef924aa5c6f02c104d9d36838b930ce) Add test - [`9ec180e`](https://github.com/langchain-ai/langgraphjs/commit/9ec180e022f251e7e14ec3fc96b4bdf78345756a) Update types to permit undefined ### 📊 Changes **2 files changed** (+29 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `libs/langgraph/src/pregel/messages.test.ts` (+25 -0) 📝 `libs/langgraph/src/pregel/messages.ts` (+4 -1) </details> ### 📄 Description When `tags: ["nostream"]` is passed to the LLM model, the metadata is not set at all, thus `handleLLMEnd` will emit an exception. --- <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:34 -05:00
yindo closed this issue 2026-02-15 20:15:34 -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#1388