[PR #1893] [MERGED] fix(sdk): infer agent types in stream.values #1817

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/1893
Author: @christian-bromann
Created: 1/13/2026
Status: Merged
Merged: 1/15/2026
Merged by: @christian-bromann

Base: mainHead: cb/stream-value-types


📝 Commits (6)

📊 Changes

8 files changed (+587 additions, -43 deletions)

View changed files

.changeset/clean-dogs-fly.md (+5 -0)
📝 examples/ui-react/package.json (+3 -3)
📝 libs/sdk/.eslintrc.cjs (+1 -1)
📝 libs/sdk/package.json (+4 -3)
📝 libs/sdk/src/react/stream.tsx (+6 -4)
libs/sdk/src/tests/stream.test-d.ts (+335 -0)
📝 libs/sdk/src/ui/types.ts (+141 -11)
📝 pnpm-lock.yaml (+92 -21)

📄 Description

This patch enables proper type propagation of agent states within useStream, e.g.:

import { useStream } from "@langchain/langgraph/react";
import type { agent } from "./agent";

const stream = useStream<typeof agent>({ ... })
stream.values // no properly reflects the agent type

🔄 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/1893 **Author:** [@christian-bromann](https://github.com/christian-bromann) **Created:** 1/13/2026 **Status:** ✅ Merged **Merged:** 1/15/2026 **Merged by:** [@christian-bromann](https://github.com/christian-bromann) **Base:** `main` ← **Head:** `cb/stream-value-types` --- ### 📝 Commits (6) - [`4754830`](https://github.com/langchain-ai/langgraphjs/commit/4754830765af17994b7b921167a025d1c5a976e3) fix(sdk): infer agent types in stream.values - [`16fdb2a`](https://github.com/langchain-ai/langgraphjs/commit/16fdb2af055fd0d5fe20ef87a9c6bea14c73ccb5) format - [`3202b53`](https://github.com/langchain-ai/langgraphjs/commit/3202b53e9ac8ae14e30cbd0f82dc5bef0709f84f) fix types - [`aedb76c`](https://github.com/langchain-ai/langgraphjs/commit/aedb76cea507d0bf0c5865b5458be9491ef5b030) cr - [`9ed6a34`](https://github.com/langchain-ai/langgraphjs/commit/9ed6a3450862b3d8e7fb685e89c202014f30f75e) Add changeset for agent type inference fix - [`fa004a6`](https://github.com/langchain-ai/langgraphjs/commit/fa004a6af0f4cdf0fa219b4eb85005ca46f1f147) feedback ### 📊 Changes **8 files changed** (+587 additions, -43 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/clean-dogs-fly.md` (+5 -0) 📝 `examples/ui-react/package.json` (+3 -3) 📝 `libs/sdk/.eslintrc.cjs` (+1 -1) 📝 `libs/sdk/package.json` (+4 -3) 📝 `libs/sdk/src/react/stream.tsx` (+6 -4) ➕ `libs/sdk/src/tests/stream.test-d.ts` (+335 -0) 📝 `libs/sdk/src/ui/types.ts` (+141 -11) 📝 `pnpm-lock.yaml` (+92 -21) </details> ### 📄 Description This patch enables proper type propagation of agent states within `useStream`, e.g.: ```ts import { useStream } from "@langchain/langgraph/react"; import type { agent } from "./agent"; const stream = useStream<typeof agent>({ ... }) stream.values // no properly reflects the agent type ``` --- <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:56 -05:00
yindo closed this issue 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#1817