mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-10-01 14:05:10 +02:00
more
This commit is contained in:
@@ -269,9 +269,6 @@ class _GraphEngineRun:
|
||||
update = result
|
||||
sends = _normalize_result_to_sends(result, default_input=node_input)
|
||||
|
||||
if update is None and isinstance(state, dict):
|
||||
# Preserve in-place state mutations for prototype nodes like wait_node.
|
||||
update = state
|
||||
if isinstance(update, dict):
|
||||
update = _reduce_update_to_changed_fields(before_state_snapshot, update)
|
||||
|
||||
|
||||
@@ -109,11 +109,11 @@ def build_main_agent(planner: MockLLM, sub_agent: Any) -> Any:
|
||||
elif channel == "user_input_channel":
|
||||
state["output"].append(f"user_input: {payload}")
|
||||
# State changed -> ask planner what to do next.
|
||||
return Command(goto=Send("llm_node", None))
|
||||
return Command(update=state, goto=Send("llm_node", None))
|
||||
else:
|
||||
state["output"].append("timer: no updates yet")
|
||||
# No meaningful state change -> keep waiting without calling planner.
|
||||
return Command(goto=Send("wait_node", None))
|
||||
return Command(update=state, goto=Send("wait_node", None))
|
||||
|
||||
async def tool_node(ctx: Context, tool_input: str) -> None:
|
||||
await asyncio.sleep(0.1)
|
||||
|
||||
Reference in New Issue
Block a user