chore: rename serde type tag "diff" → "delta" for DeltaValue

Consistent with channel/type naming (DeltaChannel, DeltaValue).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Sydney Runkle
2026-04-21 10:58:09 -04:00
co-authored by Claude Sonnet 4.6
parent 374eebcd65
commit ffda8b5472
2 changed files with 3 additions and 3 deletions
@@ -246,7 +246,7 @@ class JsonPlusSerializer(SerializerProtocol):
elif isinstance(obj, bytearray):
return "bytearray", obj
elif _is_delta_value(obj):
return "diff", _msgpack_enc({"d": obj.delta, "c": obj.prev_checkpoint_id})
return "delta", _msgpack_enc({"d": obj.delta, "c": obj.prev_checkpoint_id})
else:
try:
return "msgpack", _msgpack_enc(obj)
@@ -269,7 +269,7 @@ class JsonPlusSerializer(SerializerProtocol):
return ormsgpack.unpackb(
data_, ext_hook=self._unpack_ext_hook, option=ormsgpack.OPT_NON_STR_KEYS
)
elif type_ == "diff":
elif type_ == "delta":
from langgraph.checkpoint.base import DeltaValue # lazy import
raw = ormsgpack.unpackb(
+1 -1
View File
@@ -994,7 +994,7 @@ def test_delta_value_serde_round_trip() -> None:
delta=[{"type": "human", "content": "hi"}], prev_checkpoint_id="abc-123"
)
type_tag, blob = serde.dumps_typed(original)
assert type_tag == "diff"
assert type_tag == "delta"
loaded = serde.loads_typed((type_tag, blob))
assert isinstance(loaded, DeltaValue)
assert loaded.delta == original.delta