fix(api): Ensure is_resumption for node_started event is correctly set

This commit is contained in:
QuantumGhost
2026-01-13 09:25:44 +08:00
parent 5523df6023
commit 6bcd4ad740
9 changed files with 76 additions and 20 deletions

View File

@ -236,3 +236,10 @@ class GraphExecution:
def record_node_failure(self) -> None:
"""Increment the count of node failures encountered during execution."""
self.exceptions_count += 1
def is_node_resumption(self, node_id: str, execution_id: str) -> bool:
"""Return True if the node is resuming a previously started execution."""
node_execution = self.node_executions.get(node_id)
if not node_execution or not node_execution.execution_id:
return False
return str(node_execution.execution_id) == execution_id

View File

@ -131,9 +131,6 @@ class EventHandler:
node_execution.mark_started(event.id)
self._graph_runtime_state.increment_node_run_steps()
# Mark whether this start is part of a resume flow
event.is_resumption = self._graph_runtime_state.consume_resuming_node(event.node_id)
# Track in response coordinator for stream ordering
self._response_coordinator.track_node_execution(event.node_id, event.id)