[PR #118] [MERGED] Rename empty() to fromCheckpoint() to match LangGraph Python #502

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/118
Author: @andrewnguonly
Created: 4/16/2024
Status: Merged
Merged: 4/18/2024
Merged by: @nfcampos

Base: mainHead: migrate-channels


📝 Commits (6)

  • 66ce7bd Rename empty() to fromCheckpoint(). Update update() implementations to exactly match Python implementations.
  • 9dab480 Format tests.
  • 4df8cf9 Deep copy Checkpoint data when creating new Checkpoint.
  • f06cfb8 Remove initialValueFactory from BaseChannel.
  • 0be38eb Merge branch 'main' into migrate-channels
  • a350142 Update createCheckpoint() to exclude values carried over from previous checkpoint.

📊 Changes

8 files changed (+128 additions, -30 deletions)

View changed files

📝 langgraph/src/channels/any_value.ts (+2 -2)
📝 langgraph/src/channels/base.ts (+31 -13)
📝 langgraph/src/channels/binop.ts (+1 -1)
📝 langgraph/src/channels/ephemeral_value.ts (+2 -2)
📝 langgraph/src/channels/last_value.ts (+2 -2)
📝 langgraph/src/channels/named_barrier_value.ts (+1 -1)
📝 langgraph/src/channels/topic.ts (+1 -1)
📝 langgraph/src/tests/channels.test.ts (+88 -8)

📄 Description

Summary

All files in the channels directory are updated to match the corresponding naming and implementation in LangGraph Python.

Implementation

  1. Rename empty() to fromCheckpoint() in BaseChannel class.
  2. Update implementation of update() methods to return last element of values array.

To Do

  • Figure out if BaseChannel.createCheckpoint() is equivalent to the Python implementation.
  • Do we want to remove initialValueFactory API from BaseChannel? The API doesn't exist in the Python implementation. Static function StateGraph._getChannels() depends on this interface.

Future

  1. Remove guard API from EphemeralValue. It's not needed anymore.
  2. Make NamedBarrierValue.update() transactional (this.seen can be partially updated).

I'm keeping track of these items separately.


🔄 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/118 **Author:** [@andrewnguonly](https://github.com/andrewnguonly) **Created:** 4/16/2024 **Status:** ✅ Merged **Merged:** 4/18/2024 **Merged by:** [@nfcampos](https://github.com/nfcampos) **Base:** `main` ← **Head:** `migrate-channels` --- ### 📝 Commits (6) - [`66ce7bd`](https://github.com/langchain-ai/langgraphjs/commit/66ce7bdfa31e98a17b7588121d5f6d00cc3ec999) Rename empty() to fromCheckpoint(). Update update() implementations to exactly match Python implementations. - [`9dab480`](https://github.com/langchain-ai/langgraphjs/commit/9dab48079e8aea2bd2341a406464f5f6e3ff65ac) Format tests. - [`4df8cf9`](https://github.com/langchain-ai/langgraphjs/commit/4df8cf91cf80f33fd0a7082c28f64ee5edfe27fa) Deep copy Checkpoint data when creating new Checkpoint. - [`f06cfb8`](https://github.com/langchain-ai/langgraphjs/commit/f06cfb86cd76899c77c6185587ce435cadf1ba0d) Remove initialValueFactory from BaseChannel. - [`0be38eb`](https://github.com/langchain-ai/langgraphjs/commit/0be38eb4ee1e002007c6f618d25c99aa374fda41) Merge branch 'main' into migrate-channels - [`a350142`](https://github.com/langchain-ai/langgraphjs/commit/a3501424d51ef9808f73603108ef3a9f89f03b4a) Update createCheckpoint() to exclude values carried over from previous checkpoint. ### 📊 Changes **8 files changed** (+128 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `langgraph/src/channels/any_value.ts` (+2 -2) 📝 `langgraph/src/channels/base.ts` (+31 -13) 📝 `langgraph/src/channels/binop.ts` (+1 -1) 📝 `langgraph/src/channels/ephemeral_value.ts` (+2 -2) 📝 `langgraph/src/channels/last_value.ts` (+2 -2) 📝 `langgraph/src/channels/named_barrier_value.ts` (+1 -1) 📝 `langgraph/src/channels/topic.ts` (+1 -1) 📝 `langgraph/src/tests/channels.test.ts` (+88 -8) </details> ### 📄 Description ### Summary All files in the `channels` directory are updated to match the corresponding naming and implementation in LangGraph Python. ### Implementation 1. Rename `empty()` to `fromCheckpoint()` in `BaseChannel` class. 2. Update implementation of `update()` methods to return last element of `values` array. ### To Do - [x] Figure out if `BaseChannel.createCheckpoint()` is equivalent to the Python implementation. - [x] Do we want to remove `initialValueFactory` API from `BaseChannel`? The API doesn't exist in the Python implementation. Static function `StateGraph._getChannels()` depends on this interface. ### Future 1. Remove `guard` API from `EphemeralValue`. It's not needed anymore. 2. Make `NamedBarrierValue.update() ` transactional (`this.seen` can be partially updated). I'm keeping track of these items separately. --- <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:12 -05:00
yindo closed this issue 2026-02-15 18:17:12 -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#502