[PR #97] [MERGED] [Python Parity] Adds Waiting Edges Along with Additional Changes Needed to Make that Work #487

Closed
opened 2026-02-15 18:17:09 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/97
Author: @janvi-codaio
Created: 3/22/2024
Status: Merged
Merged: 4/16/2024
Merged by: @nfcampos

Base: mainHead: add-edge


📝 Commits (10+)

📊 Changes

10 files changed (+489 additions, -129 deletions)

View changed files

langgraph/src/channels/any_value.ts (+50 -0)
📝 langgraph/src/channels/base.ts (+16 -16)
langgraph/src/channels/ephemeral_value.ts (+55 -0)
📝 langgraph/src/channels/last_value.ts (+6 -1)
langgraph/src/channels/named_barrier_value.ts (+66 -0)
📝 langgraph/src/graph/graph.ts (+14 -4)
📝 langgraph/src/graph/state.ts (+156 -75)
📝 langgraph/src/pregel/index.ts (+13 -8)
📝 langgraph/src/pregel/write.ts (+50 -25)
📝 langgraph/src/tests/pregel.test.ts (+63 -0)

📄 Description

Parity with: https://github.com/langchain-ai/langgraph/pull/164 - the Nvidea waiting edge feature - along with all the other changes necessary to get parity with that feature

  • Adds new AnyValue channel
  • Adds new EphemeralValue channel
  • Adds new NamedBarrierValue channel (*key for waiting edges)
  • Adds _all_edges to the Graph & StateGraph
  • Update StateGraph to have waitingEdges, waitingEdgeChannels, stateChannels, updateChannels
  • Move from using Channel.writeTo -> new ChannelWrite and adding appropriate ChannelWriteEntry
  • Move from using Channel.subscribeTo -> new ChannelInvoke with appropriate triggers vs channels
  • Update Pregel write to work with a channels: Array<ChannelWriteEntry> input instead
  • Add SKIP_WRITE
  • Support multiple message passing
  • Adds a unit test to test_pregel that tests this feature

A couple of flyby changes:

  • Rename the generic types in BaseChannel because IMO it's very confusing whether C was a Checkpoint or Channel
  • Add some comments on how LastValue works and how it differs from AnyValue

🔄 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/97 **Author:** [@janvi-codaio](https://github.com/janvi-codaio) **Created:** 3/22/2024 **Status:** ✅ Merged **Merged:** 4/16/2024 **Merged by:** [@nfcampos](https://github.com/nfcampos) **Base:** `main` ← **Head:** `add-edge` --- ### 📝 Commits (10+) - [`517f652`](https://github.com/langchain-ai/langgraphjs/commit/517f652ed36841bb1d69e81b3ce79dce7692f5ee) add basic - [`c502131`](https://github.com/langchain-ai/langgraphjs/commit/c5021314943ebc24ac8f4d287cdb7997af813ce8) update - [`e3496e1`](https://github.com/langchain-ai/langgraphjs/commit/e3496e15f5bf987ba832a4c82bf1d669e4fd5c7d) update - [`3a17f8d`](https://github.com/langchain-ai/langgraphjs/commit/3a17f8d2209a8346afee1d3580e1b7a1dfe35125) update - [`da46331`](https://github.com/langchain-ai/langgraphjs/commit/da46331efe8703cc1ba12b4d009a27182e75a897) this kinda works - [`7d0763e`](https://github.com/langchain-ai/langgraphjs/commit/7d0763eec6f1093cdf13688a744f916e05603cd0) format everything - [`9d80285`](https://github.com/langchain-ai/langgraphjs/commit/9d80285b91a32e066c1f1dde1846acfe2f7d51ce) update - [`6643249`](https://github.com/langchain-ai/langgraphjs/commit/6643249c6ac298fbd6a1a3be35c77c10cf147cec) update - [`fff5b08`](https://github.com/langchain-ai/langgraphjs/commit/fff5b085e5f1d9937d74d742f28948f34018fb0c) Merge branch 'main' into add-edge - [`ab8a720`](https://github.com/langchain-ai/langgraphjs/commit/ab8a7209375d97c6540b1c6f743ed5d6f200f055) Merge branch 'main' into add-edge ### 📊 Changes **10 files changed** (+489 additions, -129 deletions) <details> <summary>View changed files</summary> ➕ `langgraph/src/channels/any_value.ts` (+50 -0) 📝 `langgraph/src/channels/base.ts` (+16 -16) ➕ `langgraph/src/channels/ephemeral_value.ts` (+55 -0) 📝 `langgraph/src/channels/last_value.ts` (+6 -1) ➕ `langgraph/src/channels/named_barrier_value.ts` (+66 -0) 📝 `langgraph/src/graph/graph.ts` (+14 -4) 📝 `langgraph/src/graph/state.ts` (+156 -75) 📝 `langgraph/src/pregel/index.ts` (+13 -8) 📝 `langgraph/src/pregel/write.ts` (+50 -25) 📝 `langgraph/src/tests/pregel.test.ts` (+63 -0) </details> ### 📄 Description Parity with: https://github.com/langchain-ai/langgraph/pull/164 - the Nvidea waiting edge feature - along with all the other changes necessary to get parity with that feature - [x] Adds new AnyValue channel - [x] Adds new EphemeralValue channel - [x] Adds new NamedBarrierValue channel (*key for waiting edges) - [x] Adds _all_edges to the Graph & StateGraph - [x] Update StateGraph to have waitingEdges, waitingEdgeChannels, stateChannels, updateChannels - [x] Move from using `Channel.writeTo` -> `new ChannelWrite` and adding appropriate `ChannelWriteEntry` - [x] Move from using `Channel.subscribeTo` -> `new ChannelInvoke` with appropriate triggers vs channels - [x] Update Pregel `write` to work with a `channels: Array<ChannelWriteEntry>` input instead - [x] Add `SKIP_WRITE` - [x] Support multiple message passing - [x] Adds a unit test to test_pregel that tests this feature A couple of flyby changes: - [x] Rename the generic types in `BaseChannel` because IMO it's very confusing whether `C` was a `Checkpoint` or `Channel` - [x] Add some comments on how LastValue works and how it differs from AnyValue --- <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 18:17:09 -05:00
yindo closed this issue 2026-02-15 18:17:09 -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#487