Skip to content

fix(executor): stop run-from-block reusing the source run's branch state - #8287

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/run-from-block-stale-edge-state
Sep 25, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/run-from-block-stale-edge-state

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Run-from-block seeds the new run from a previous execution's snapshot. It filtered block states, executed blocks, and loop/parallel state to the reachable set, but restored the source run's deactivatedEdges / nodesWithActivatedEdge unfiltered (since improvement(executor): subflows, hitl handling cleanup  #4604 added edge restore for pause/resume)
  • With the join-readiness rule from fix(executor): preserve disabled-branch execution and join readiness #7537, that stale state made a condition's unselected target run whenever the source run had taken that branch, and released a join before its live input finished (the join then ran a second time with the real value)
  • Fix: after restoring, clear the edge state for the run-from-block dirty set with the existing EdgeManager.clearDeactivatedEdgesForNodes — the same reset the loop orchestrator does per iteration and the parallel orchestrator does per batch
  • Resume is unaffected (it never sets runFromBlockContext); parallels were already reset per batch; upstream cached state is untouched

Type of Change

  • Bug fix

Testing

  • New executor.run-from-block.test.ts: a real full run, then a real executeFromBlock from that run's snapshot, through the actual engine (only block handlers mocked). Covers unselected branch, re-selected branch, diamond join both ways, cached sibling input, fan-in join, condition in a loop, condition in a parallel. 5 of 8 fail without the fix; the other 3 guard unchanged behavior
  • executor, lib/workflows, app/api/workflows, lib/mothership/tools suites: 7,613 tests passing
  • tsc, lint, block registry, check:audits (49 audits), docs manifest all pass

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 25, 2026 2:24am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Fixes branch state carryover in run-from-block execution.

The PR appears safe to merge; no actionable regression was identified.

Summary

The PR clears restored routing state for nodes re-executed by run-from-block while preserving cached upstream state.

  • Adds full-run-to-rerun tests for branch selection, joins, loops, and parallel branches.
  • Clarifies the edge-reset method’s intended uses.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Source execution snapshot] --> B[Restore block and edge state]
  B --> C{Run from block?}
  C -- Yes --> D[Clear edge state sourced by dirty nodes]
  C -- No --> E[Keep restored edge state]
  D --> F[Execute selected block and downstream nodes]
  E --> G[Continue normal or resumed execution]
Loading

Reviews (1) · Last reviewed commit: "fix(executor): stop run-from-block reusi..."

@waleedlatif1
waleedlatif1 merged commit da76452 into staging Sep 25, 2026
24 of 25 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/run-from-block-stale-edge-state branch September 25, 2026 02:28

This branch was previously deployed

1 inactive deployment
Preview — 00ea813e Deployed Sep 25, 2026 by vercel[bot]
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