chore: rename DiffChannel/DiffDelta/DiffChainValue to Delta* across libs

Renames the diff-channel types to DeltaChannel, DeltaValue, and DeltaChainValue
for consistency with the settled naming convention.
This commit is contained in:
Sydney Runkle
2026-04-22 14:03:37 -04:00
parent ed9711fd33
commit b799b95138
16 changed files with 313 additions and 128 deletions
@@ -438,7 +438,7 @@ class PostgresSaver(BasePostgresSaver):
*,
cur: Any = None,
) -> dict[str, Any]:
from langgraph.checkpoint.base import DiffChainValue
from langgraph.checkpoint.base import DeltaChainValue
result: dict[str, Any] = {}
for channel, current_payload in diff_channel_payloads.items():
@@ -469,7 +469,7 @@ class PostgresSaver(BasePostgresSaver):
break
payloads.reverse()
result[channel] = DiffChainValue(
result[channel] = DeltaChainValue(
base=base, deltas=[p["d"] for p in payloads]
)
return result
@@ -399,7 +399,7 @@ class AsyncPostgresSaver(BasePostgresSaver):
*,
cur: Any,
) -> dict[str, Any]:
from langgraph.checkpoint.base import DiffChainValue
from langgraph.checkpoint.base import DeltaChainValue
result: dict[str, Any] = {}
for channel, current_payload in diff_channel_payloads.items():
@@ -430,7 +430,7 @@ class AsyncPostgresSaver(BasePostgresSaver):
break
payloads.reverse()
result[channel] = DiffChainValue(
result[channel] = DeltaChainValue(
base=base, deltas=[p["d"] for p in payloads]
)
return result
@@ -223,7 +223,7 @@ class BasePostgresSaver(BaseCheckpointSaver[str]):
*,
cur: Any = None,
) -> dict[str, Any]:
"""Override in sync/async subclasses. Resolves diff-chain blobs to DiffChainValue."""
"""Override in sync/async subclasses. Resolves diff-chain blobs to DeltaChainValue."""
raise NotImplementedError
def _dump_blobs(
+5 -5
View File
@@ -374,22 +374,22 @@ async def test_get_checkpoint_no_channel_values(
@pytest.mark.parametrize("saver_name", ["base", "pool", "pipe"])
async def test_diff_channel_chain_reconstruction(saver_name: str) -> None:
"""AsyncPostgresSaver reconstructs DiffChannel chain via point-lookup traversal."""
async def test_delta_channel_chain_reconstruction(saver_name: str) -> None:
"""AsyncPostgresSaver reconstructs DeltaChannel chain via point-lookup traversal."""
pytest.importorskip(
"langgraph.channels.diff", reason="langgraph core not installed"
"langgraph.channels.delta", reason="langgraph core not installed"
)
from typing import Annotated
from langchain_core.messages import AIMessage, HumanMessage
from langgraph.channels.diff import DiffChannel
from langgraph.channels.delta import DeltaChannel
from langgraph.graph import START, StateGraph
from langgraph.graph.message import add_messages
from typing_extensions import TypedDict
class State(TypedDict):
messages: Annotated[list, DiffChannel(add_messages)]
messages: Annotated[list, DeltaChannel(add_messages)]
def respond(state: State) -> dict:
n = len(state["messages"])