Skip to content

fix: workflow incorrectly marked as completed while nodes are still executing#48

Open
tomerqodo wants to merge 4 commits intoaugment_combined_20260121_augment_sentry_coderabbit_1_base_fix_workflow_incorrectly_marked_as_completed_while_nodes_are_still_executing_pr441from
augment_combined_20260121_augment_sentry_coderabbit_1_head_fix_workflow_incorrectly_marked_as_completed_while_nodes_are_still_executing_pr441
Open

fix: workflow incorrectly marked as completed while nodes are still executing#48
tomerqodo wants to merge 4 commits intoaugment_combined_20260121_augment_sentry_coderabbit_1_base_fix_workflow_incorrectly_marked_as_completed_while_nodes_are_still_executing_pr441from
augment_combined_20260121_augment_sentry_coderabbit_1_head_fix_workflow_incorrectly_marked_as_completed_while_nodes_are_still_executing_pr441

Conversation

@tomerqodo
Copy link
Copy Markdown

Benchmark PR from qodo-benchmark#441

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Jan 22, 2026

🤖 Augment PR Summary

Summary: Fixes a workflow-graph execution edge case where the overall run could be marked complete while downstream nodes are still expected to run.

Changes:

  • In skip propagation, when any incoming edge is TAKEN, the downstream node is now marked as executing via GraphStateManager.start_execution() before it is enqueued.
  • Adjusts skip propagation behavior for outgoing edges when a node is skipped (ordering of propagation vs edge-state updates).
  • Adds a dedicated unit-test suite for SkipPropagator covering unknown/taken/all-skipped incoming edge scenarios and basic recursion behavior.
  • Adds a test package __init__.py for graph traversal unit tests.

Technical Notes: Completion is determined by an empty ready-queue and an empty executing-nodes set, so marking nodes as executing earlier helps prevent premature completion checks.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

if edge_states["has_taken"]:
# Enqueue node
# Start execution and enqueue node
print(f"Starting execution for node: {downstream_node_id}")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The print(...) here will write to stdout from core workflow execution, which is likely noisy in production and can interfere with test output capture. Consider using the project logger (or removing this) if you need diagnostics.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

for edge in outgoing_edges:
self._state_manager.mark_edge_skipped(edge.id)
# Recursively propagate skip
self.propagate_skip_from_edge(edge.id)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

propagate_skip_from_edge(edge.id) is invoked before the edge is marked as skipped, so the downstream node will typically see this incoming edge as UNKNOWN and stop propagation. Since mark_edge_skipped happens after, there’s no follow-up propagation call, which can break recursive skip propagation.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

mock_graph.get_outgoing_edges.return_value = [edge1, edge2]

# Setup get_incoming_edges to return empty list to stop recursion
mock_graph.get_incoming_edges.return_value = []
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test sets get_incoming_edges to [], which makes analyze_edge_states() treat the downstream node as all_skipped=True regardless of whether the outgoing edge was actually marked skipped. That setup can mask regressions around the ordering between mark_edge_skipped() and propagate_skip_from_edge().

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant