interrupt goes first

This commit is contained in:
lda
2026-05-22 21:40:53 +07:00 Verified
parent 6802593d2a
commit 6c1c8abc52
5 changed files with 169 additions and 4 deletions
+2 -1
View File
@@ -74,6 +74,7 @@ def advance_frame(
*,
outcome: str,
next_node_id: str,
front: bool = False,
) -> None:
frame.prior_outcome = outcome
frame.activated_incoming_edge = frame.node_id
@@ -84,7 +85,7 @@ def advance_frame(
wake_parent_for_child_progress(run, frame.id)
else:
frame.finished_at_node_id = None
mark_frame_pending(run, frame.id)
mark_frame_pending(run, frame.id, front=front)
run.sync_from_current_frame()
+2
View File
@@ -53,6 +53,7 @@ def complete_step(
) -> RunState:
"""Record a completed step and advance the active frame."""
next_node_id = index.next_node_id(node_id, outcome)
next_step = index.nodes_by_id.get(next_node_id)
append_step_result_trace(
run,
@@ -67,6 +68,7 @@ def complete_step(
run.frames[frame_id],
outcome=outcome,
next_node_id=next_node_id,
front=isinstance(next_step, InterruptNode),
)
return run