Summary
When a sequential subworkflow (type: workflow) is re-entered via a loop-back route (i.e. invoked a second time in the same run), the web dashboard's inline-expanded view keeps rendering the first (already-completed) invocation instead of the live, currently-running one. The bottom Activity tab correctly shows live events/turns for the running iteration, but the graph node detail panel for agents inside the subworkflow (e.g. a technical_reviewer node) shows stale status: completed / Iteration 1 data while the agent is actually mid-way through a second pass.
Root cause
Each subworkflow_started event for a re-invoked subworkflow creates a new SubworkflowContext and pushes it onto the parent context's children array (workflow-store.ts, subworkflow_started handler) rather than reusing/replacing the prior one. So after a loop-back, children contains two (or more) contexts sharing the same slotKey (the agent name) — one completed, one running.
Two different lookups resolve "the" child context for a given slotKey, and they disagree:
findChildContext (workflow-store.ts), used by navigateIntoSubworkflow (double-click drill-in / breadcrumb navigation), iterates newest-first — correctly resolves to the latest invocation.
graph-layout.ts, in both layoutContext's inline-expand rendering (ctx.children.findIndex((c) => c.slotKey === a.name), ~line 493) and collectExpandableContextKeys's walk (~line 148), uses Array.prototype.findIndex, which returns the first match.
Because the inline-expanded graph pins its childContextKey to that first (stale) index, it never picks up the newer context even though the engine and store are actively updating it. Manually double-clicking into the subworkflow re-navigates via findChildContext and correctly lands on the live iteration — but the default inline view does not self-correct.
Repro
- Build a workflow where a
type: workflow subworkflow (e.g. document_review) is invoked, and a route later loops back to invoke it again (e.g. a reviewer rejects and routes back for another pass).
- Run with
--web and inline-expand the subworkflow node in the graph.
- Let the loop-back trigger a second invocation.
- Observe: the inline-expanded child DAG still shows the first invocation's agents as
completed at Iteration 1, while the Activity tab shows ongoing turns/tool calls for the same agent name — the live second iteration is invisible unless you collapse and double-click back into the subworkflow.
Suggested fix
Align graph-layout.ts's child-context resolution (both the inline-expand path in layoutContext and collectExpandableContextKeys) with findChildContext's newest-first semantics, so the inline view always tracks the latest invocation of a repeated subworkflow slot, consistent with double-click navigation.
Environment
- Observed on Conductor v0.1.26, web dashboard.
Summary
When a sequential subworkflow (
type: workflow) is re-entered via a loop-back route (i.e. invoked a second time in the same run), the web dashboard's inline-expanded view keeps rendering the first (already-completed) invocation instead of the live, currently-running one. The bottom Activity tab correctly shows live events/turns for the running iteration, but the graph node detail panel for agents inside the subworkflow (e.g. atechnical_reviewernode) shows stalestatus: completed/Iteration 1data while the agent is actually mid-way through a second pass.Root cause
Each
subworkflow_startedevent for a re-invoked subworkflow creates a newSubworkflowContextand pushes it onto the parent context'schildrenarray (workflow-store.ts,subworkflow_startedhandler) rather than reusing/replacing the prior one. So after a loop-back,childrencontains two (or more) contexts sharing the sameslotKey(the agent name) — one completed, one running.Two different lookups resolve "the" child context for a given
slotKey, and they disagree:findChildContext(workflow-store.ts), used bynavigateIntoSubworkflow(double-click drill-in / breadcrumb navigation), iterates newest-first — correctly resolves to the latest invocation.graph-layout.ts, in bothlayoutContext's inline-expand rendering (ctx.children.findIndex((c) => c.slotKey === a.name), ~line 493) andcollectExpandableContextKeys's walk (~line 148), usesArray.prototype.findIndex, which returns the first match.Because the inline-expanded graph pins its
childContextKeyto that first (stale) index, it never picks up the newer context even though the engine and store are actively updating it. Manually double-clicking into the subworkflow re-navigates viafindChildContextand correctly lands on the live iteration — but the default inline view does not self-correct.Repro
type: workflowsubworkflow (e.g.document_review) is invoked, and a route later loops back to invoke it again (e.g. a reviewer rejects and routes back for another pass).--weband inline-expand the subworkflow node in the graph.completedatIteration 1, while the Activity tab shows ongoing turns/tool calls for the same agent name — the live second iteration is invisible unless you collapse and double-click back into the subworkflow.Suggested fix
Align
graph-layout.ts's child-context resolution (both the inline-expand path inlayoutContextandcollectExpandableContextKeys) withfindChildContext's newest-first semantics, so the inline view always tracks the latest invocation of a repeated subworkflow slot, consistent with double-click navigation.Environment