[PR #1410] [MERGED] fix(langgraph): stop suggesting public properties and methods of Command when calling invoke #1442

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/1410
Author: @dqbd
Created: 7/16/2025
Status: Merged
Merged: 7/17/2025
Merged by: @dqbd

Base: mainHead: dqbd/command-instance-typing-invoke


📝 Commits (3)

  • 5130c89 fix(langgraph): stop suggesting public properties and methods of Command when calling invoke
  • e0ca373 Create wise-schools-boil.md
  • bc259d6 Fix tests

📊 Changes

4 files changed (+38 additions, -15 deletions)

View changed files

.changeset/wise-schools-boil.md (+5 -0)
📝 libs/langgraph/src/constants.ts (+18 -1)
📝 libs/langgraph/src/pregel/index.ts (+7 -6)
📝 libs/langgraph/src/tests/prebuilt.test.ts (+8 -8)

📄 Description

Since TypeScript is a structural type system, it does not distinguish between an instance of Command and an object that has the same shape as a Command, thus invoke(...) / stream(...) suggests bogus keys.

CleanShot 2025-07-17 at 01 41 14@2x

We can (mis)use Symbols to still validate against an instance of Command while hiding these bogus keys.

CleanShot 2025-07-17 at 01 41 32@2x

🔄 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/1410 **Author:** [@dqbd](https://github.com/dqbd) **Created:** 7/16/2025 **Status:** ✅ Merged **Merged:** 7/17/2025 **Merged by:** [@dqbd](https://github.com/dqbd) **Base:** `main` ← **Head:** `dqbd/command-instance-typing-invoke` --- ### 📝 Commits (3) - [`5130c89`](https://github.com/langchain-ai/langgraphjs/commit/5130c899bbd8d422d3448a971cfd878c828ed62a) fix(langgraph): stop suggesting public properties and methods of Command when calling invoke - [`e0ca373`](https://github.com/langchain-ai/langgraphjs/commit/e0ca37304d90916754937ade9d745f0a5da6ab21) Create wise-schools-boil.md - [`bc259d6`](https://github.com/langchain-ai/langgraphjs/commit/bc259d66aad124c32f6914fa2b81e0d906eb891b) Fix tests ### 📊 Changes **4 files changed** (+38 additions, -15 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/wise-schools-boil.md` (+5 -0) 📝 `libs/langgraph/src/constants.ts` (+18 -1) 📝 `libs/langgraph/src/pregel/index.ts` (+7 -6) 📝 `libs/langgraph/src/tests/prebuilt.test.ts` (+8 -8) </details> ### 📄 Description Since TypeScript is a structural type system, it does not distinguish between an instance of Command and an object that has the same shape as a Command, thus `invoke(...) / stream(...)` suggests bogus keys. <img width="1448" height="946" alt="CleanShot 2025-07-17 at 01 41 14@2x" src="https://github.com/user-attachments/assets/17968eb9-449a-45ac-9120-17a82c16d2f5" /> We can (mis)use Symbols to still validate against an instance of Command while hiding these bogus keys. <img width="1544" height="990" alt="CleanShot 2025-07-17 at 01 41 32@2x" src="https://github.com/user-attachments/assets/859c6ad6-700b-4e2f-b83f-9481f5ac60dd" /> --- <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:47 -05:00
yindo closed this issue 2026-02-15 20:15:47 -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#1442