Skip to content

Dashboard: inline-expanded subworkflow shows stale iteration after loop-back re-invocation #361

Description

@jrob5756

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

  1. 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).
  2. Run with --web and inline-expand the subworkflow node in the graph.
  3. Let the loop-back trigger a second invocation.
  4. 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.

Activity

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions