Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos committed Oct 15, 2024
1 parent 5e175e0 commit d48faec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions libs/langgraph/langgraph/pregel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ def _prepare_state_snapshot(
saved.checkpoint,
LoopProtocol(
config=saved.config,
step=saved.metadata["step"],
stop=saved.metadata["step"] + 1,
step=saved.metadata.get("step", -1) + 1,
stop=saved.metadata.get("step", -1) + 2,
),
skip_context=True,
) as (channels, managed):
Expand Down Expand Up @@ -522,8 +522,8 @@ async def _aprepare_state_snapshot(
saved.checkpoint,
LoopProtocol(
config=saved.config,
step=saved.metadata["step"],
stop=saved.metadata["step"] + 1,
step=saved.metadata.get("step", -1) + 1,
stop=saved.metadata.get("step", -1) + 2,
),
skip_context=True,
) as (
Expand Down Expand Up @@ -852,7 +852,7 @@ def update_state(
with ChannelsManager(
self.channels,
checkpoint,
LoopProtocol(config=config, step=step, stop=step + 1),
LoopProtocol(config=config, step=step + 1, stop=step + 2),
) as (
channels,
managed,
Expand Down Expand Up @@ -1002,7 +1002,7 @@ async def aupdate_state(
async with AsyncChannelsManager(
self.channels,
checkpoint,
LoopProtocol(config=config, step=step, stop=step + 1),
LoopProtocol(config=config, step=step + 1, stop=step + 2),
) as (
channels,
managed,
Expand Down
1 change: 0 additions & 1 deletion libs/scheduler-kafka/langgraph/scheduler/kafka/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ async def attempt(self, msg: MessageToExecutor) -> None:
step=saved.metadata["step"] + 1,
stop=saved.metadata["step"] + 2,
),
self.graph.store,
) as (channels, managed), AsyncBackgroundExecutor() as submit:
if task := await asyncio.to_thread(
prepare_single_task,
Expand Down

0 comments on commit d48faec

Please sign in to comment.