fix(web): resolve inline-expanded subworkflow to newest invocation on loop-back - #364
Merged
Merged
Conversation
… loop-back The dashboard's inline-expanded subworkflow view resolved a repeated slotKey child SubworkflowContext via Array.prototype.findIndex, which returns the first (oldest) match. When a loop-back route re-invokes the same sequential subworkflow, the engine/store correctly appends a new sibling context, but the inline view kept pinning its childContextKey to the stale, already-completed first invocation instead of the live one — even though double-click navigation and the Activity tab correctly tracked the live run. Fix both affected call sites in graph-layout.ts (collectExpandableContextKeys and layoutContext's inline-expand branch for type: workflow steps) to match newest-first, mirroring the existing convention already used elsewhere (workflow-store.ts::findChildContext/resolveSlotPath, issue #145; and hooks/use-deep-link.ts::resolveSubworkflowPath). Adds regression tests simulating a subworkflow that completes once and is then re-invoked via a loop-back route, verifying both fixed call sites resolve to the newest (live) context rather than the stale completed one. Fixes #361 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Jason Robert (jrob5756)
force-pushed
the
fix/361-stale-subworkflow-iteration
branch
from
August 3, 2026 21:20
5e5e39c to
37184be
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #361.
The dashboard's inline-expanded subworkflow view resolved a repeated
slotKeychildSubworkflowContextviaArray.prototype.findIndex, which returns the first (oldest) match. When a loop-back route re-invokes the same sequential subworkflow, the engine/store correctly appends a new sibling context, but the inline view kept pinning itschildContextKeyto the stale, already-completed first invocation instead of the live one — even though double-click navigation and the Activity tab correctly tracked the live run.Root cause
Two call sites in
graph-layout.tsusedfindIndex(first-match) instead of the newest-first matching convention already established elsewhere in the codebase:workflow-store.ts::findChildContext/resolveSlotPath(issue Follow-up from PR #113: tighten proactor AssertionError suppression + small comment/docstring nits #145)hooks/use-deep-link.ts::resolveSubworkflowPathFix
collectExpandableContextKeysandlayoutContext's inline-expand branch fortype: workflowsteps now matchslotKeynewest-first, consistent with the rest of the codebase.static/viamake build-frontendso the fix ships in the bundled dashboard.Testing
npx vitest run— 53/53 tests passnpx tsc -b— clean typecheckReview
Ran code-reviewer, pr-test-analyzer, and comment-analyzer sub-agents on the diff; addressed all findings (added a status assertion, tightened two comments). code-simplifier found no further simplification opportunities.