[PR #1895] fix(sdk): prevent stale client closure in useStream hook #1820

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/1895
Author: @sivashankar0398-cmyk
Created: 1/14/2026
Status: 🔄 Open

Base: mainHead: fix-stale-client-hook


📝 Commits (1)

  • a777dc9 fix(sdk): prevent stale client closure in useStream hook

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 libs/sdk/src/react/stream.lgp.tsx (+1 -1)

📄 Description

Fixes #1840.

This change prevents the useStream hook from capturing a stale client reference
after a token refresh. The callback is now updated when the client configuration
changes, ensuring fresh authentication is always used and avoiding 403 errors.

Tests:

  • pnpm --filter @langchain/langgraph-sdk test

🔄 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/1895 **Author:** [@sivashankar0398-cmyk](https://github.com/sivashankar0398-cmyk) **Created:** 1/14/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-stale-client-hook` --- ### 📝 Commits (1) - [`a777dc9`](https://github.com/langchain-ai/langgraphjs/commit/a777dc91e2cb49b4061eda43b2070ec48dfb7ab0) fix(sdk): prevent stale client closure in useStream hook ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `libs/sdk/src/react/stream.lgp.tsx` (+1 -1) </details> ### 📄 Description Fixes #1840. This change prevents the `useStream` hook from capturing a stale client reference after a token refresh. The callback is now updated when the client configuration changes, ensuring fresh authentication is always used and avoiding 403 errors. Tests: - pnpm --filter @langchain/langgraph-sdk test --- <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:16: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#1820