Skip to content

Commit 9f3f511

Browse files
bsboddenclaude
andcommitted
fix(serializer)!: update Interrupt deserialization for LangGraph 1.0
BREAKING CHANGE: Interrupt object structure changed in LangGraph 1.0 LangGraph 1.0 simplified the Interrupt class from 4 fields to 2 fields: - Removed: resumable, ns, when - Retained: value, id Updated JsonPlusRedisSerializer._revive_if_needed() to detect and reconstruct Interrupt objects using the new 2-field structure. Changes: - Check for len(obj) == 2 instead of len(obj) == 4 - Check for "id" field instead of "resumable" - Construct Interrupt(value=..., id=...) instead of old signature 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7309462 commit 9f3f511

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

langgraph/checkpoint/redis/jsonplus_redis.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,24 +135,21 @@ def _revive_if_needed(self, obj: Any) -> Any:
135135
return self._reviver(obj)
136136

137137
# Check if this is a serialized Interrupt object
138-
# Interrupt objects serialize to {"value": ..., "resumable": ..., "ns": ..., "when": ...}
138+
# LangGraph 1.0+: Interrupt objects serialize to {"value": ..., "id": ...}
139139
# This must be done before recursively processing to avoid losing the structure
140140
if (
141141
"value" in obj
142-
and "resumable" in obj
143-
and "when" in obj
144-
and len(obj) == 4
145-
and isinstance(obj.get("resumable"), bool)
142+
and "id" in obj
143+
and len(obj) == 2
144+
and isinstance(obj.get("id"), str)
146145
):
147146
# Try to reconstruct as an Interrupt object
148147
try:
149148
from langgraph.types import Interrupt
150149

151150
return Interrupt(
152151
value=self._revive_if_needed(obj["value"]),
153-
resumable=obj["resumable"],
154-
ns=obj["ns"],
155-
when=obj["when"],
152+
id=obj["id"],
156153
)
157154
except (ImportError, TypeError, ValueError) as e:
158155
# If we can't import or construct Interrupt, log and fall through

0 commit comments

Comments
 (0)