Skip to content

feat: lead the run graph's error handler to the node that receives its output - #12516

Merged
rubenfiszel merged 30 commits into
mainfrom
flow-graph-error-handler-result-edge
Nov 20, 2026
Merged

rubenfiszel merged 30 commits into
mainfrom
flow-graph-error-handler-result-edge

Conversation

@hugocasa

@hugocasa hugocasa commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

When a flow's error handler ran, the run graph drew its marker off the failed step, leading nowhere, as a step that looked like any other. This makes the error path readable at a glance:

  • The handler node shows the bug icon (the error handler's icon in the editor) instead of its language icon.
  • An edge leads from the handler to the node that actually receives its output, so the run reads like a try/catch whose catch produced the result.
  • In a finished run, the path the run took is drawn as plain lines and the path it did not take is dashed and faded: edges through steps that never ran, and the failed step's own way out. Where that way out leads to the handler's own target, the handler's edge replaces it.
  • A collapsed subflow says "N error handlers ran" below it when handlers ran inside; clicking it expands the subflow. A loop showing an iteration without a handler says "Error handler ran in iteration K" for the first failed iteration that ran one; clicking it opens that iteration.
  • When a collapsed subflow had both retried steps and error handlers inside, the line below it shows the retry icon and the bug icon with their counts, and clicking it opens a menu with one entry for each. Only one of the two keeps the single button ("2 steps retried inside", "2 error handlers ran").

Where the handler's output goes was checked on real runs and in worker_flow.rs (payload_from_modules gives each loop iteration, branch-all branch and branch-one branch its own inner flow job with a copy of the handler, and has_triggered_error_handler keeps outer levels from running it again):

Failed step sits in Handler's output becomes Edge goes to
a for-loop or while-loop that iteration's entry in the loop's array (the run then ends with that array) <loop>-end
a branch-all that branch's entry <branchall>-end
a branch-one the branch-one's result, passed through whatever encloses the branch-one
a branch-one with continue on error the branch-one's result, and the flow carries on <branchone>-end
nothing else the flow's result Result, or End of subflow inside an expanded subflow

Changes

  • processModules threads a handlerTarget down the structure tree and records it per step; the marker block draws the edge to it.
  • The handler's out edge is pushed straight into edges, not through addEdge, so it stays out of parents: the compound layout groups nodes by walking parents, and an edge from inside a branch-one to Result pulled Result into the branch's group.
  • Where the handler and its target sit in one column, the edge runs along the existing path rather than detouring around the column: a wide arc read as more confusing than the overlap.
  • The marker of an expanded subflow step hangs off the subflow's end rather than its start, since the step failed as a whole.
  • The failed step keeps its structural edge, so the steps after it stay attached; it is marked bypassed, dashed, and hidden when it leads to the node the handler's edge leads to.
  • A loop or branch that failed as a whole (its iterator threw) leaves through its end node, so that exit is dashed too.
  • Edge styles are read from run state in the renderers (edgeRunClass.ts), not baked into edge data, so a poll never rebuilds the edge set. The builder only adds static flags: whether an edge belongs to the handler, the steps at either end of an edge, and bypassed.
  • "Never ran" needs a finished run, since a step not reached yet may still run: FlowStatusViewerInner passes runDone to FlowGraphV2, which sets it on the run-status context (didNotRun).
  • The retried-inside line moves from FlowModuleSchemaItem to ModuleNode, next to the handler count, so the two can share one line and one menu (DropdownV2).
  • The handler count (nestedErrorHandlers.ts) walks the run's job tree from the frontend: a handler ran when a flow job's flow_status.failure_module.job is set. No server endpoint lists every job under a run (parent_job only matches direct children), so the walk is kept small:
    • It only goes below a job whose flow has an error handler or a subflow step, since iterations and branches only carry a copy of their flow's handler. A loop is only asked when the builder sees one of those (mayRunErrorHandler).
    • Only failed iterations and branches are asked, in the loop label and in a subflow's count alike; the loop label also stops at the first iteration that ran a handler.
    • All walks share 4 request slots, a step is only counted once it has finished, and the count is recomputed only when the step's jobs change, not on every status update.
    • Finished jobs are cached for the page's life; a walk that failed is dropped from the cache.

Not covered:

  • A failed preprocessor keeps its marker without an edge (the edge would span the whole graph).
  • An iteration that ran a handler but still succeeded is skipped by the loop label and by a subflow's count: its handler returned recover: true, or it sat in a branch-one with continue on error. Finding it would mean asking every successful iteration, which a loop of thousands cannot afford. Opening that iteration shows its handler.
  • A loop whose iterator threw is stored as Failure, but the run viewer draws it without a state, so the edge into it is dashed as not run.
  • Where the handler's edge runs down the same column as steps that never ran (branch-one below), that stretch is drawn plain, since it is the handler's path.

Demo

1795189627-eh-demo.mp4

Screenshots

Before is the released UI (v1.858.0), after is this branch, on the same runs.

Before After
Handler returned recover: true before after
Expanded subflow: child handler and parent handler ran before after
Collapsed subflow with handlers inside before after
Collapsed subflow with retries and a handler inside, menu open before after
Loop iteration whose last step failed before after
Branch-one: untaken branch and skipped steps before after

Test plan

  • graphBuilder.test.ts: handler edge targets loop-end, Result through a branch-one, <branchone>-end for a continuing branch-one, sub-subflow-end in an expanded subflow; a failed last step's exit is replaced, a whole-loop failure's loop-end exit is bypassed
  • edgeRunClass.test.ts: a handler's edge stays plain next to a step that did not run; replaced, bypassed and not-run edges
  • npm run check:fast: only the 4 errors main already has; vitest on src/lib/components/graph: 39 passed
  • Job requests on opening a run, besides the run itself: a 200-iteration loop without a handler sends none for its iterations; the same loop with a handler that never ran sends 1 (the shown iteration) instead of 200; batch 9, nested subflow 7
  • Real runs on a local instance for each case in the table, checking the flow result and the drawn edges
  • Run page: top level, for-loop (iteration selector), branch-all, branch-one, branch-one with continue on error, expanded subflow
  • Count label: "2 error handlers ran" on the collapsed batch subflow; in the expanded batch loop "Error handler ran in iteration 2" shows on iteration 1 and hides on iterations 2 and 4, which draw their own handler
  • Retries and a handler in one subflow: the collapsed line shows ⟳2 and the bug 1, the menu lists "2 steps retried inside" and "1 error handler ran", and each entry expands the subflow

🤖 Generated with Claude Code


Summary by cubic

Leads a flow's error handler marker to the node that actually receives its output, so a handled failure reads like a try/catch ending in a result. The run graph now also paints the run: handler edges render in red (green when the handler returns recover: true), edges through steps the finished run never reached fade and dash, and a card under a collapsed subflow or loop shows how many steps were retried or error handlers ran off-screen.

Where the handler leads

  • In a loop or branch-all, the handler's output lands in that iteration's or branch's entry, so the edge goes to <loop>-end or <branchall>-end.
  • In a branch-one it passes through the branch's result to Result, or to <branchone>-end when the branch continues on error.
  • Otherwise it ends at Result, or the subflow's end when the subflow is expanded.
  • An expanded subflow step failed as a whole, so its marker hangs off the subflow's end.

Run painting

  • Error handler cards show a bug icon, and one bar under a subflow or loop shows both "N error handlers ran" and "M steps retried inside"; with both, a small menu routes each to expanding the subflow or jumping to the iteration. Counts walk only the failed jobs where a handler could have run, fetching them a few requests at a time.
  • The handler edge stays out of parents so the layout doesn't pull Result into a branch group; the failed step keeps its structural edge so the steps after it stay attached.
  • A failed preprocessor and a failed last step inside a loop or branch still draw the marker without a usable edge; that predates this change.

Written for commit 4f60e55. Summary will update on new commits.

View guided diff Turn on auto-fix

hugocasa and others added 9 commits November 17, 2026 22:09
…un graph

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…branch note only on success

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… with brand guidelines

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…raph

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s output

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hugocasa
hugocasa added this pull request to stack #12517 November 17, 2026 22:40
@hugocasa

Copy link
Copy Markdown
Collaborator Author

/review

@claude

claude Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @hugocasa's task in 53s —— View job


Good to merge

Review: PR #12516

  • Gather context (the two PR commits against flow-graph-retries-subflow-skeleton)
  • Review graphBuilder.svelte.ts, EmptyEdge.svelte and the tests
  • Post review

Findings

I found no P0, P1 or P2 issues. What I checked:

  • How handlerTarget is passed down (graphBuilder.svelte.ts)
    • For-loops, while-loops and branch-all branches pass their own endNode.id.
    • A branch-one passes on the target it was given, or its own end when continue_on_error is set.
    • An expanded subflow resets the target to its own -subflow-end, which matches what the worker does.
    • The simplified trigger view passes no target, so it gets no edge. That is correct.
  • Nested cases follow the table in the PR description
    • A branch-one inside a loop with no continue on error sends the edge to <loop>-end.
    • When a loop or branch-all step fails as a whole (for example its iterator expression throws), the step is registered under the outer target before its children are walked, so the edge goes to the right place.
  • Keeping the edge out of parents
    • Pushing straight into edges means detectCycle and the compound layout never see the cross-group edge. The comment explains why someone shouldn't "simplify" this back to addEdge.
    • Edge ids (edge:${failureId}->${target}) are unique, because toAdd is keyed by failing step.
  • Marker anchor for an expanded subflow
    • ${parentId}-subflow-end always exists when expandedSubflows[parentId] is set: the end node is pushed in the same branch that registers the expansion.
  • EmptyEdge.svelte
    • data defaults to {}, so reading data.bowWhenAligned is safe for existing callers.
    • The bow is opt-in, so other empty edges are unaffected.
    • The 0.75k peak for a cubic whose two control points share an x offset is correct, so the curve clears the card by about half the horizontal gap.

AGENTS.md compliance

  • The comments state constraints (why the edge is kept out of parents, why the structural edge stays, why the bow exists), not narration. They fit within the ≤4-line guidance.
  • No crypto.randomUUID, no new exported surface, and the change stays within its stated scope.

Test coverage

  • What the PR adds: graphBuilder.test.ts is the sibling pure-logic test for this builder. The new cases pin the edge target for a loop, a pass-through branch-one, a continuing branch-one and an expanded subflow. That is the right regression guard.
  • What it doesn't test: the bow in EmptyEdge is purely visual, and the screenshots cover it.
  • Not run here: I could not run vitest in this environment, because the command needed approval.

Manual check before merge: on a run page, open a run whose failed step sits inside a branch-one nested in a for-loop, with no continue on error. Select the failed iteration and confirm the dashed edge from the handler marker goes to the loop's end node, not to Result. That nesting isn't in the screenshots or the new tests.

hugocasa and others added 2 commits November 17, 2026 23:41
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ound the column

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4f60e55
Status: ✅  Deploy successful!
Preview URL: https://509545ea.windmill.pages.dev
Branch Preview URL: https://flow-graph-error-handler-res.windmill.pages.dev

View logs

…ton' into flow-graph-error-handler-result-edge
@hugocasa

Copy link
Copy Markdown
Collaborator Author

/review

@claude

claude Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @hugocasa's task in 1m 0s —— View job


Good to merge

Review: PR #12516 (second pass)

  • Gather context: the three PR commits against flow-graph-retries-subflow-skeleton
  • Review what changed since my last pass. 3ef3220 removed the EmptyEdge bow, so the PR now touches only graphBuilder.svelte.ts and its test.
  • Post review

Findings

I found no P0, P1 or P2 issues.

What changed since the last review

  • The dashed edge now uses the existing EmptyEdge renderer, styled with data.class: '[stroke-dasharray:4_4]'. EmptyEdge already merges data.class through twMerge.
  • tailwind.config.cjs scans ./src/**/*.{html,js,svelte,ts}, so the arbitrary property in a .ts file gets generated.
  • Nothing is left of the bow, so no other empty edge can be affected.

Checks I repeated on the current head

  • Edge targets match the worker's behaviour:
    • Loops and branch-all branches pass their own endNode.id.
    • A branch-one passes on the target it received, or endNode.id when continue_on_error is set.
    • An expanded subflow resets the target to its endId.
    • The simplified trigger view passes no target, so it draws no edge.
  • A step that fails as a whole (a loop, branch-all or expanded subflow) is recorded under the outer target before its children are walked. This happens in graphBuilder.svelte.ts:870, ahead of the type dispatch, so the step keeps the outer target.
  • An expanded subflow step that fails:
    • Its marker hangs off ${parentId}-subflow-end.
    • expandedSubflows and that end id are both keyed by the prefixed module.id, so the lookup also holds for a subflow nested inside another one.
  • The edge is pushed straight into edges, not through addEdge:
    • It never enters parents, so detectCycle and the compound grouping don't see it.
    • Its id edge:${failureId}->${target} is unique, because toAdd keys markers by failing step.
  • Branch-one inside a loop: last time I asked for a manual check of a branch-one nested in a for-loop with no continue on error. The code covers it: the branch-one passes on the loop's endNode.id, so the edge goes to <loop>-end.

AGENTS.md compliance

  • The comments state constraints rather than narrate. They cover why the edge stays out of parents, why the structural edge stays, and why the marker anchors at the subflow end. Each is within the ≤4-line guidance.
  • The comment above handlerTarget reads as current state. Nothing in it describes how the code was drafted.
  • No new exported surface. The test helper (build, ran, hasEdge) is file-local.

Test coverage

  • Frontend pure logic: graphBuilder.test.ts is the right sibling test. The new cases pin the edge target for four cases: a loop, a branch-one that passes its result on to Result, a branch-one with continue on error (edge to boc-end), and an expanded subflow (edge to sub-subflow-end). That is the right regression guard, and nothing in the test is scaffolding.
  • Not run: I couldn't run vitest here because the command needed approval.

Manual check before merge: open a run whose top-level step fails while the flow has an error handler. Confirm the dashed edge runs from the handler marker to Result along the existing column path, overlapping it rather than arcing around it, and that it reads clearly in both light and dark mode. The current screenshots were taken before 3ef3220 removed the bow.

@github-actions

Copy link
Copy Markdown
Contributor

Codex Review

Good to merge

No blocking findings or actionable nits in the two-file diff. Handler targets follow the enclosing execution scope, and the new edges stay out of layout ancestry.

Test coverage

The tests cover loop, branch-one, continuing branch-one, and expanded-subflow destinations. I attempted the focused Vitest command, but it could not run because frontend dependencies are absent.

I did not independently exercise the UI. The PR’s reported real-run checks sufficiently cover the affected run-page behavior; no additional manual verification is required before merge.

@github-actions

Copy link
Copy Markdown
Contributor

Pi Review

Good to merge

This PR threads a handlerTarget through processModules in frontend/src/lib/components/graph/graphBuilder.svelte.ts so an error-handler marker draws a dashed edge to the node that consumes its output. I traced every call site and the marker loop against the semantics table in the PR body and against FlowStatusViewerInner.svelte's failure-state handling, and found no blocking issues.

What I verified:

  • Every processModules call site passes the new handlerTarget correctly. Top-level normal passes resultNode.id; group recursion passes it through; branch-all/for-loop/while-loop pass their -end node; branch-one passes endNode.id when continue_on_error is set, otherwise the enclosing target; expanded subflow resets to its own -subflow-end. The simplified-trigger-view call passes no target, so no edges are produced there (and Result isn't pushed in that mode, so it would be a dangling target otherwise — the code avoids it).
  • handlerTargets keying matches the marker loop's parentId. For top-level steps both are the plain module id; for expanded subflows the prefix rewrite produces subflow:<prefix>:<oid> and the loop computes nodePrefix + parent_module, which is the same convention the pre-existing nodes.some(...) guard already relies on for the anchor edge.
  • continue_on_error is a real top-level FlowModule field (used in flowStepSettings.ts), so the branch-one target choice is well-founded.
  • The directly-pushed edge is safe. It only needs data.class (read by EmptyEdge.svelte, with data = {} default); getSubflowNodeIds reads e.data?.disableMoveIds ?? []; the edge is selectable: false and EmptyEdge sets pointer-events-none + interactionWidth={0}, so no interaction path touches it.
  • Bypassing parents is correct. compoundLayout groups nodes exclusively from node.parentIds, which is fed by the parents map — so the cross-group handler edge can't pull Result into a branch/loop group. The comment documents this as a constraint, matching the AGENTS.md rule that comments record constraints rather than narration.

Test coverage: graphBuilder.test.ts (a pure-logic sibling test) is extended to pin the edge target for a loop (loop-end), a pass-through branch-one (Result), a continuing branch-one (boc-end), and an expanded subflow (sub-subflow-end). These are the right regression guards. The dashed styling and the "stacked below the failed last step" layout quirk are visual and covered by the PR's screenshots. I attempted to run the test but dependencies aren't installed in this checkout (vite config can't resolve @sveltejs/kit), so I could not execute it — the assertions were traced by hand instead.

Manual verification: the PR lists real-run checks on the run page for each table row; the one combination not in the screenshots or the new tests is a failed step inside a branch-one nested in a for-loop with no continue-on-error, where the dashed edge should reach <loop>-end rather than Result — worth a quick look on a live run.

Considered and dismissed

  • Minimal data on the handler edge (only class) breaking an edge consumer — dismissed: no consumer of edges reads sourceId/targetId/eventHandlers from this edge; moveManager and EmptyEdge tolerate the shape, and the edge is inert.
  • expandedSubflows[parentId] anchor producing a dangling ${parentId}-subflow-end node — dismissed: the end node is pushed in the same branch that checks the expansion, and the key (plain or subflow:-prefixed id) equals the parentId the marker loop computes.
  • Prefixed module.id vs unprefixed parent_module mismatch in handlerTargets — dismissed: parentId = nodePrefix + parent_module is the identical id the existing anchor/nodes.some logic already uses, so no new mismatch is introduced.
  • Duplicate edge ids — dismissed: edge:${id}->${target} is unique because toAdd is keyed by failing step and the source is a failure-marker id that no structural edge uses.
  • Tailwind class [stroke-dasharray:4_4] not generated — dismissed: standard arbitrary-property class, and the PR screenshots confirm it renders.
  • Handler edge hidden in useDataflow mode (empty type) — dismissed: pre-existing; the marker anchor edge was already empty, so no regression.

hugocasa and others added 9 commits November 18, 2026 00:04
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…retry line for the preprocessor and error handler

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Guilhem-lm

Copy link
Copy Markdown
Contributor

/review

@github-actions

Copy link
Copy Markdown
Contributor

Codex Review

cc @hugocasa

Should address issues before merging: eager handler-count fetches, cached descendant failures

  1. [P1] Eager handler-count fetches — frontend/src/lib/components/graph/renderers/nodes/ModuleNode.svelte:142

    Opening a run graph immediately fetches every loop iteration to compute the optional badge, even for successful runs without any error handlers. Collapsed subflows similarly scan their entire descendant tree. Using the exact new derivation and helper with a stub service, a successful 1,000-iteration loop issued 1,000 concurrent getJob calls and displayed no badge. This adds substantial API traffic whenever large runs are opened. Use batched or aggregated counts, or make the scan explicitly on demand with bounded concurrency.

  2. [P2] Cached descendant failures — frontend/src/lib/components/graph/nestedErrorHandlers.ts:17

    If the parent fetch succeeds but a descendant fetch fails, countIn rejects inside the async fulfillment callback. The sibling rejection callback only handles failure of the parent's getJob, so the rejected parent promise remains cached. Later status updates reuse it and silently hide the badge even after connectivity recovers. I reproduced this: a second count attempt made no new request after the child service recovered. Evict rejected entries by catching failures from the whole promise chain.

Test coverage

The builder tests cover handler destinations. The latest commit adds no tests for recursive counting, cache recovery, or edge styling logic; focused utility tests would help pin these behaviors. Svelte component tests are unnecessary.

I ran exact-78f5348 Node reproductions with a stub JobService for both findings; git diff --check passed. Focused Vitest could not start because vitest is absent. The author reports type checks, 36 passing graph tests, and real-run verification; I did not independently exercise the browser.

After fixing the fetch behavior, open a large successful loop run and inspect network traffic: displaying the graph should avoid fetching every iteration individually.

Temporarily fail a descendant job request, restore connectivity, and trigger another status update. The handler-count badge should recover without reloading the page.

@github-actions

Copy link
Copy Markdown
Contributor

Pi Review

cc @hugocasa

Should address issues before merging: unbounded per-iteration getJob fetches in the loop error-handler count (P1), compound-step exit edge stays solid on whole-step failure (P2)

P1 — ModuleNode.svelte:142 / nestedErrorHandlers.ts — the loop error-handler count fires one job fetch per iteration, unbounded and concurrent

For every for/while-loop node in a run graph, hiddenErrorHandlers runs:

Promise.all(iterations.map((id) => countErrorHandlersUnder(workspace, id)))

where iterations = state.flow_jobs. That array is the full iteration-job list — the worker pre-fills it for parallel loops (flow_jobs: Some(uuids.clone()) in worker_flow.rs), so a 1,000-iteration loop yields 1,000 entries. Consequences:

  • One GET /w/{workspace}/jobs/get/{id} per iteration, all fired at once (Promise.all, no concurrency limit).
  • Re-fetched while the run is in progress: countErrorHandlersUnder deletes its cache entry for any non-CompletedJob, and the $derived.by re-runs whenever the loop's state object changes (each poll replaces it), so a running loop re-fires the batch every update. Only finished iterations are cached.
  • Done unconditionally — there is no gate on the flow even having a failure_module, so a loop in a flow with no error handler still triggers N fetches that all return 0.

On a batch platform where loops with hundreds/thousands of iterations are routine, this is an observable performance regression on the run page (hundreds of concurrent API calls on load, and again per poll while running). This should be capped/batched, gated on the flow actually having a failure_module, or aggregated server-side before merge.

P2 — graphBuilder.svelte.ts:1320 — a loop/branch-all failing as a whole leaves its <module>-end → next exit edge un-faded

The bypassed pass only marks edges with edge.source === anchor, and anchor is the failed step's own id (parentId). For a compound step the flow's "way out" is the edge from its end node (loop-end, branchall-end), not from the step id itself. When a loop's iterator throws (whole-step failure), anchor = 'loop', so loop-end → Result is never marked bypassed; it also has no steps (neither endpoint is a module node), so the didNotRun fading never reaches it either.

The result is a solid loop-end → Result edge drawn next to the red marker → Result edge — exactly the "two paths into that node" the 'replaced' logic (line 1322) was written to avoid, and the case the PR body itself calls out ("a loop or branch-all step fails as a whole"). The same gap applies to a branch-all / branch-one whose own evaluation throws.

Considered and dismissed

  • finishedCounts keyed by jobId without a workspace — dismissed: job ids are UUIDs, globally unique.
  • Unbounded growth of the finishedCounts cache — dismissed: entries are tiny (a resolved Promise<number>) and the comment documents the "kept for the page's life" intent.
  • countIn not recursing into the handler's own job tree — dismissed: a handler that is itself a flow with its own nested handlers is a rare edge case, and counts were validated against real runs.
  • runDone not threaded through FlowGraphViewer / FlowGraphDiffViewer — dismissed: those viewers pass no flowModuleStates, so showsRun is false and the fade/tone logic is inert there.
  • Minimal data on the handler out-edge breaking an edge consumer — dismissed: it is rendered only by EmptyEdge, edgeRunClass reads only the handler field, the edge is selectable: false with pointer-events-none, and the stepIds pass skips it (no module endpoints).
  • Duplicate edge ids for the out-edge — dismissed: edge:${markerId}->${target} is unique because marker ids are unique.
  • didNotRun treating WaitingForPriorSteps/skipped as "did not run" — dismissed: correct semantics for a finished run.

Test coverage

  • Frontend pure logic: graphBuilder.test.ts is extended with the right regression guards for the edge-target cases (loop-end, pass-through branch-one → Result, continuing branch-one → boc-end, expanded subflow → sub-subflow-end). The new edgeRunClass.ts is pure logic whose branch logic (handler tone, bypassed replaced/not-run, steps → didNotRun) is untested — a small sibling *.test.ts would be cheap, but the function is small enough that this is not blocking. nestedErrorHandlers.ts is I/O-bound and not the kind of file this repo unit-tests.
  • Backend / CI / docs: not touched by this PR.

Manual verification still needed: (1) run a flow whose for-loop iterator throws and confirm the loop-end → Result edge renders solid next to the red handler edge (the P2 above — the PR's screenshots do not cover this whole-step failure); (2) open the run page for a loop with a few hundred iterations and watch the network tab to confirm the N getJob requests described in the P1.

… at a time

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Guilhem-lm

Copy link
Copy Markdown
Contributor

/review

@claude

claude Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @Guilhem-lm's task in 1m 24s —— View job


cc @hugocasa
Mergeable, but should ideally address nits: a collapsed subflow's handler count still requests every loop iteration under it (nestedErrorHandlers.ts)

Review: PR #12516 (fourth pass)

  • Gather context: the new commit since the last pass is 0382a76, which responds to the fan-out finding. The merge of main (4e85317) brings in unrelated files, so I reviewed the graph files only.
  • Review nestedErrorHandlers.ts, ModuleNode.svelte, graphBuilder.svelte.ts and the two test files
  • Post review

Findings

P2: a collapsed subflow still walks every iteration (nestedErrorHandlers.ts:60, inline comment posted)

  • What happens: countIn pushes every entry of mod.flow_jobs. The loop label was changed to ask only for failed iterations, but the subflow count was not.
  • Example: a collapsed subflow whose flow has a handler and contains a 2,000-iteration loop sends 2,000+ requests when the run opens. They now go 4 at a time, which is why this is no longer a P1, but the label takes a long time to appear and other walks wait behind it.
  • Possible fixes: skip iterations whose flow_jobs_success[i] === true, which gives up counting recovered handlers just as the loop path already does. Or stop at the first hit and show the label without a count.

Earlier findings, now addressed

  • Unbounded fan-out (my P1, Codex P1, Pi P1):
    • A loop is only asked when mayRunErrorHandler is set. That flag is set when the flow (at the loop's prefix) has a handler or the loop body has a flow step.
    • failureModulesByPrefix['subflow:'+prefix] is set before the expanded subflow's modules are processed (graphBuilder.svelte.ts:1233), so a loop nested in an expanded subflow sees it.
    • countIn skips the walk below a job whose flow has neither a handler nor a subflow step.
    • The loop path asks for the shown iteration, then only the failed iterations, one at a time, and stops at the first hit.
    • All walks share 4 request slots. A slot is released before countIn recurses, so a nested walk cannot deadlock waiting on its own parent.
  • Re-walking on every poll:
    • handlerCountKey covers only job_id, selectedForloopIndex and flow_jobs. state is read inside untrack.
    • A step that is still running gets no count, so a running loop sends no requests and the label no longer flickers.
  • Failed walks stuck in the cache (Codex P2): count.catch(() => forget(...)) now covers the whole chain, including a child that rejects. forget checks that the cached entry is still the same promise, so an older failure cannot evict a newer attempt.
  • Whole-loop failure exit not faded (Pi P2): exits = [anchor, ${anchor}-end] marks loop-end → next as bypassed, and the new test pins it. For a script step, ${anchor}-end matches no node, so the extra entry does nothing there.

AGENTS.md compliance

  • The new comments state constraints rather than narrate: why the slots are shared, why only failed iterations are asked, and why state is untracked.
  • No deprecated Button props.
  • New exports (firstIterationWithHandler, mayRunErrorHandler) are internal to the graph, and like the existing reads they go through the user's own getJob.

Test coverage

  • Frontend pure logic:
    • edgeRunClass.test.ts is a new sibling test that pins the precedence order, as asked last time.
    • The new graphBuilder.test.ts case pins replaced for a failed last step and bypassed for loop-end → next when the loop fails as a whole.
    • These are the right guards. nestedErrorHandlers.ts is I/O-bound, so no test is expected for it.
  • Not run: I did not run vitest or npm run check here.

Manual checks:

  • Open a finished run of a flow with an error handler and a loop of a few hundred successful iterations. The network tab should show one get request for the shown iteration and none for the others.
  • Open a run that is still going on with a loop and confirm that no get requests for iterations fire on each poll until the loop finishes.

const children: string[] = []
for (const mod of status.modules) {
if (mod.flow_jobs?.length) {
children.push(...mod.flow_jobs)

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.

P2: a collapsed subflow still requests every loop iteration under it.

The loop label now asks only for failed iterations (firstIterationWithHandler). The subflow count goes through countIn, though, and that still pushes every entry of mod.flow_jobs. Take a collapsed subflow whose flow has an error handler and contains a 2,000-iteration loop: opening the run sends 2,000+ getJob requests. They are now 4 at a time, so the page is not flooded, but the label keeps filling in for a long time, and the parent's walks waiting on the same 4 slots fall behind it.

One way to bound it is to skip iterations and branches where mod.flow_jobs_success?.[i] === true, the same as the loop path. The cost is the trade-off the loop path already accepts: a handler that returned recover: true would not be counted. Another way is to stop at the first hit and show "Error handlers ran" without a number.

@github-actions

Copy link
Copy Markdown
Contributor

Codex Review

cc @hugocasa

Should address issues before merging: terminal approval detail returns HTTP 400

  1. [P1] Support approval on the last visible step — backend/windmill-api/src/jobs.rs:5928

    The new endpoint rejects a step when is_last_module is true, calculated from the full flow_version.value. Deployment appends a virtual successor after a terminal suspend step only in the executable flow_version_lite. Consequently, a deployed flow ending in an approval really suspends, but this endpoint returns HTTP 400 saying it is not an approval step. Determine eligibility from the executable definition or runtime successor.

Test coverage

Backend approval tests cover status classification but omit this deployed-flow case. Frontend tests cover handler destinations and edge classes; recursive counting lacks a committed regression test. CI/docs changes need no additional automated tests.

Exact-head smoke checks passed for graph counting, concurrency, cache recovery, edge classes, CLI errors, eval excerpts, session data, and Python retry logic. Full suites and live-instance checks were unavailable because dependencies and a running instance were absent. The full diff check reported generated-file trailing whitespace.

Deploy a flow ending in an approval, run until suspended, and request that step’s approval detail. It should return HTTP 200 with status: waiting.

The author reports real-run graph verification; dark-mode rendering remains unchecked. Shared-session access, SDK flow-test execution, and worker cancellation paths were not independently exercised live.

@github-actions

Copy link
Copy Markdown
Contributor

Pi Review

Good to merge

I reviewed the three PR commits (330326a3, 78f5348, 0382a769) against the prior review discussion. The latest commit specifically addresses the P1 (unbounded per-iteration getJob fan-out) and both P2s (compound-step exit edge left solid, cached descendant failures) raised in earlier passes. I re-derived each fix from the current head and found them correct, and no new blocking issues.

Considered and dismissed

  • Unbounded concurrent fan-out (prior P1, ModuleNode.svelte / nestedErrorHandlers.ts) — dismissed. Four independent fixes now land together: (1) loopMayRunErrorHandler in graphBuilder.svelte.ts sets mayRunErrorHandler on a loop only when its flow has a failure_module or the loop body contains a flow step, gating the loop walk entirely; (2) countIn short-circuits (return own) when raw_flow has no failure_module and no subflow step, so a handler cannot exist below; (3) a 4-slot global semaphore (MAX_REQUESTS/inFlight/waiting) bounds concurrency across all walks; (4) firstIterationWithHandler walks only success[i] === false iterations sequentially and stops at the first hit, instead of Promise.all over all iterations. The inFlight check-and-increment is synchronous (no await between them), so it cannot overshoot the limit.
  • Cached descendant failures (prior P2, nestedErrorHandlers.ts) — dismissed. count.catch(() => forget(jobId, count)) now evicts a rejected entry regardless of whether the parent getJob or a descendant countIn threw; forget guards with === count so it never evicts a newer entry.
  • Compound-step exit edge stayed solid on whole-step failure (prior P2, graphBuilder.svelte.ts) — dismissed. exits = [anchor, ${anchor}-end] now catches the loop-end → next / branchall-end → next edge when the step failed as a whole, and graphBuilder.test.ts pins it (bypassed(whole, 'loop-end', 'next') === true).
  • Sequential firstIterationWithHandler still O(n) when many iterations failed but no handler ran — dismissed. This only happens when mayRunErrorHandler is true (a handler or subflow exists) and there are failed iterations and none ran a handler (e.g. skip_failures: true). It is sequential, small (noLogs/noCode), and stops at the first hit in the normal case; the author documents the tradeoff. Not an observable regression in the common path the prior finding described.
  • countIn returning early when raw_flow is absent — dismissed. raw_flow is populated for deployed flows (getJob resolves raw values), and without it module types can't be determined anyway; the previous code's types map would be empty too.
  • flow_jobs_success undefined → firstIterationWithHandler skips everything — dismissed. Graceful degradation (no label), and for a finished loop the worker fills flow_jobs_success.
  • Handler out-edge in parents / pulled into a branch group — dismissed. It is pushed directly into edges, not through addEdge, so parents/detectCycle/compound grouping never see it; it is selectable: false, rendered by EmptyEdge (which sets pointer-events-none + interactionWidth={0}).
  • Duplicate edge ids / steps pass clobbering handler/bypassed — dismissed. edge:${markerId}->${target} is unique per marker; the steps pass uses spread { ...edge.data, steps }, and edgeRunClass checks data.handler then data.bypassed before data.steps.
  • Bug icon leaking into the editor — dismissed. isErrorHandler is only set by addNode(module, { isErrorHandler: true }), which runs only when !extra.editMode; in edit mode addFailureNode emits a FailureModuleN, not a ModuleN.
  • runDone only threaded through FlowStatusViewerInner — dismissed. Other FlowGraphV2 callers pass no flowModuleStates, so showsRun is false and edgeRunClass returns '' (fading/tone inert there).
  • finishedCounts cache growth / "page's life" wording vs module lifetime — dismissed (as in the prior pass): entries are tiny resolved promises and the intent is documented.
  • Dark-mode shades one step darker, unchecked visually — dismissed. Cosmetic and explicitly acknowledged in the PR body.

Test coverage

  • Frontend pure logic: graphBuilder.test.ts (extended) and the new edgeRunClass.test.ts are the right sibling tests. They pin the handler-edge destinations (loop-end, pass-through branch-one → Result, continuing branch-one → boc-end, expanded subflow → sub-subflow-end), the replaced/bypassed edge marking including the whole-loop case, and the tone precedence (handler tone beats not-run fading; replaced hides, bypassed/not-run fade). These are the essential regression guards, not scaffolding.
  • nestedErrorHandlers.ts is I/O-bound (JobService.getJob) rather than pure logic, and has no sibling test. The walk, short-circuit, and cache-eviction behavior are exercised by the PR's real-run checks; a mock-JobService unit test would be nice-to-have but is not required under the frontend guidance.
  • Svelte components (MapItem.svelte, ModuleNode.svelte, BaseEdge.svelte, EmptyEdge.svelte): no component tests expected.

Manual verification

The in-app surface — the run-page graph with handler markers, red/green handler edges, faded never-run paths, and the per-iteration/collapsed-subflow handler labels — is exercised by the PR's test plan on real runs across all table cases (top-level, for-loop iteration selector, branch-all, branch-one, branch-one with continue-on-error, expanded subflow, recover: true, iterator-throw loop) with DOM checks on edge colours/hidden/faded classes. The one item not visually confirmed is the dark-mode colour shade, which the author flags in the PR body; a quick dark-mode pass over one run with a red and a green handler edge is the only remaining look worth taking before merge.

Guilhem-lm and others added 3 commits November 19, 2026 06:32
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er-result-edge

Keeps both sides in flowRunStatus.svelte.ts (didNotRun/handlerEdgeTone and retriedStepsInside) and ModuleNode.svelte (hidden error handlers and the attempts/retried-inside derivations).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…edge' into flow-graph-error-handler-result-edge
Base automatically changed from flow-graph-retries-subflow-skeleton to main November 20, 2026 12:58
Guilhem-lm and others added 4 commits November 20, 2026 05:49
…steps that did not run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…subflow, drop the not-run outline

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…edge' into flow-graph-error-handler-result-edge
@Guilhem-lm

Copy link
Copy Markdown
Contributor

/review

@claude

claude Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @Guilhem-lm's task in 1m 31s —— View job


cc @hugocasa
Mergeable, but should ideally address nits: the subflow and loop handler counts miss a handler that ran inside an iteration that still succeeded (nestedErrorHandlers.ts)

Review: PR #12516 (fifth pass)

  • Gather context. Since my fourth pass the PR has three commits of its own: 253ceeb, e07e9af and 3c684eb. The two merges of main bring in unrelated files, so I reviewed only this PR's graph and map files.
  • Review nestedErrorHandlers.ts, edgeRunClass.ts and its test, graphBuilder.svelte.ts, ModuleNode.svelte, FlowModuleSchemaItem.svelte and MapItem.svelte
  • Post review

Findings

P2: handlers that ran inside a successful iteration are not counted (nestedErrorHandlers.ts:61, inline comment posted)

  • What changed: 253ceeb makes countIn walk only iterations and branches with flow_jobs_success[i] === false. That fixes the request fan-out I flagged last time.
  • What it misses: an iteration can run a handler and still succeed. Take a branch-one with continue_on_error inside a loop body. The branch's own flow job runs the handler, and the iteration then carries on, as your table shows. The iteration ends as a success, so the filter skips it.
  • Effect: a collapsed subflow wrapping such a loop shows no "N error handlers ran", or a count that is too low. firstIterationWithHandler has the same gap for the loop label.
  • Possible fixes: also walk successful iterations when the loop body has a continue_on_error branch-one. raw_flow tells you that without a request. Or list this case under "Not covered" next to recover: true.

What changed since my last pass, and checks I made

  • e07e9af + 3c684eb: edges and the dashed outline
    • Handler edges are now drawn plain. HandlerEdge and handlerEdgeTone are gone, and handler is now just true.
    • edgeRunClass returns '' for handler edges before it looks at bypassed or steps, so the handler's path is never faded.
    • The notRun dashed outline, added in e07e9af, is removed again in 3c684eb. No leftover prop is passed through MapItem or FlowModuleSchemaItem.
  • 3c684eb: retry and handler counts share one line
    • The "retried inside" line moves from FlowModuleSchemaItem to ModuleNode, where insideBar renders it.
    • It is rendered in both the {#await} pending branch and the resolved branch. So the retry count shows straight away and is not held back by the handler walk.
    • With both counts, the line becomes a DropdownV2 with one entry for each. With one count it is a single Button that uses unifiedSize and no deprecated props.
    • The old button was disabled={!maximizeSubflow}. The new one calls expandSubflow, which does nothing without a subflowPath. A flow step always has a path, so behaviour is the same.
    • The edit-mode guards remain: !data.editMode is checked in both retriedInside and handlerCountKey.
  • Earlier fixes still hold:
    • handlerCountKey still covers only finished steps and their job ids.
    • The 4 request slots are unchanged.
    • The cache still drops a walk that failed.

AGENTS.md compliance

  • The new comments state constraints rather than narration. For example: "Left of the settings bar, which is this step's own policy", and why only failed iterations are asked.
  • The UI uses Button and DropdownV2, not raw elements, and no @deprecated props.
  • No new exported surface beyond graph-internal types.

Test coverage

  • Frontend pure logic: edgeRunClass.test.ts was updated for the plain handler edge: it stays '' next to a step that did not run. The replaced, bypassed and not-run cases are unchanged. That is the right guard.
  • Not expected: nestedErrorHandlers.ts does I/O, and the Svelte components need no tests.
  • Not run: I did not run vitest or npm run check here.

Manual checks:

  • Combined line: open a finished run of a flow that has a collapsed subflow in which one step was retried and an error handler ran. The line below the subflow should show the retry and bug counts. The menu should list both entries, and each should expand the subflow. While the handler count is still loading, the line should show the retry count alone.
  • The nit above: run a flow with an error handler whose for-loop body holds a branch-one with continue_on_error, and make the chosen branch fail. Wrap it in a subflow step and leave it collapsed. Today no handler count appears below it, even though a handler ran.

for (const mod of status.modules) {
if (mod.flow_jobs?.length) {
// Failed iterations and branches only, as in `firstIterationWithHandler`.
children.push(...mod.flow_jobs.filter((_, i) => mod.flow_jobs_success?.[i] === false))

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.

P2: a handler can run inside an iteration that still succeeded, and this filter misses it.

Take an iteration whose body has a branch-one with continue_on_error. The branch's own flow job runs the handler copy. The PR's table says the flow then carries on, so the iteration can finish as a success (flow_jobs_success[i] === true), and this filter skips it. A collapsed subflow wrapping such a loop then shows no "N error handlers ran", or a lower count. firstIterationWithHandler has the same gap for the loop label.

This is narrow, and filtering out successful iterations is the right trade-off for request volume. Two options:

  • Also walk a successful iteration when its loop body has a continue_on_error branch-one. You can tell that from raw_flow without a request.
  • Or add this case to the PR's "Not covered" list next to recover: true.

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.

Right, an iteration can run a handler and still succeed, through a branch-one with continue on error as well as recover: true. Keeping the filter: walking successful iterations is the per-iteration fan-out the filter exists to avoid (a 200-iteration loop sent 200 requests), and gating it on a continue_on_error branch-one in the body would still ask every iteration of such a loop. Listed under "Not covered" with the recover: true case; opening the iteration shows its handler.

@github-actions

Copy link
Copy Markdown
Contributor

Codex Review

Good to merge

No new issues found in the exact PR-head diff. The earlier request fan-out, cached-failure, and compound-step exit findings are addressed.

Test coverage

The frontend regression tests cover handler destinations, bypassed exits, and edge-class precedence. Exact-head, in-memory smoke checks passed for successful-iteration filtering, caching, descendant-failure recovery, the four-request limit, iteration selection, and edge classes. git diff --check passed. Focused Vitest could not run because frontend dependencies are absent.

I did not independently exercise the browser. Verify a collapsed subflow containing retries and error handlers: both counts should appear together, and either menu entry should expand it. On a finished failed run, confirm the handler reaches the correct destination and skipped paths appear dashed in both themes.

@github-actions

Copy link
Copy Markdown
Contributor

Pi Review

Good to merge

Reviewed the full diff (base fb13514 → head 4f60e55, including the three commits after the last completed bot review: 0382a76 skip-successful-iterations fix, e07e9af run-path fading, 3c684eb combined retry/handler counts). The error-handler marker now threads a handlerTarget through processModules so its out-edge lands on the node that consumes its output, and the "N error handlers ran" / "M steps retried inside" badge is bounded and gated. I traced every processModules call site against the PR body's semantics table and re-derived the counting and cache logic; the earlier P1 (unbounded per-iteration fan-out) and both P2s are correctly fixed in the current head.

Considered and dismissed

  • countIn builds types from top-level flow.modules while status.modules[].id can be a nested id — dismissed: the recursion re-fetches each loop-iteration / branch-all / branch-one / subflow job and calls countIn on it, and each of those sub-jobs carries its own raw_flow (payload_from_modules in worker_flow.rs) whose modules are exactly the loop-body/branch/subflow top level, so types.get(mod.id) matches status.modules ids at every level. A flow step nested inside a loop is reached through the iteration job, not the parent's status.modules.
  • Handler count double-counts because has_triggered_error_handler is set at outer levels — dismissed: when a parallel node's child ran the handler, the worker sets the flag so the outer flow does not reach its failure module; flow_status.failure_module (and thus own = status.failure_module?.job ? 1 : 0) is only set where the handler actually ran.
  • The 4-slot semaphore in nestedErrorHandlers.ts can overshoot — dismissed: the inFlight >= MAX_REQUESTS check and inFlight++ are synchronous with no await between them, and each finally decrements before shifting exactly one waiter.
  • A rejected walk stays cached (prior Codex P2) — dismissed: count.catch(() => forget(jobId, count)) covers the whole chain (parent getJob and any descendant countIn), and forget guards with === count so a stale failure can't evict a newer attempt.
  • Handler out-edge pulled into a branch/loop group via parents — dismissed: it is edges.pushed directly, never through addEdge, so parents/detectCycle/compound grouping never see the cross-group edge; it is selectable: false and rendered only by EmptyEdge (pointer-events-none, interactionWidth={0}).
  • Compound-step exit edge (loop-end → next) left solid on whole-step failure — dismissed: exits = [anchor, ${anchor}-end] now catches it, pinned by bypassed(whole, 'loop-end', 'next') === true.
  • steps pass clobbering handler/bypassed flags — dismissed: it spreads { ...edge.data, steps }, and edgeRunClass checks handler → bypassed → steps in that precedence order.
  • didNotRun/runDone leaking into the editor or other viewers — dismissed: edgeRunClass returns '' when !status?.showsRun, and every FlowGraphV2 caller other than FlowStatusViewerInner passes no flowModuleStates, so showsRun stays false there.
  • Re-walking on every poll — dismissed: handlerCountKey is a value-stable string over job_id/selectedForloopIndex/flow_jobs, and state is read inside untrack, so a poll that replaces the state object with identical values does not invalidate the derived.
  • Bug icon leaking into the editor — dismissed: isErrorHandler is set only by addNode(module, { isErrorHandler: true }), which runs only in non-edit mode; the edit-mode addFailureNode emits a FailureModuleN instead.
  • retriedInside prop removal leaving a dangling caller — dismissed: the only consumer was ModuleNode, now rendering insideBar; no other FlowModuleSchemaItem/MapItem caller passes it.
  • DropdownV2 buttonReplacement snippet and iconColor item field — dismissed: both are supported in the current DropdownV2 / Item definitions.
  • firstIterationWithHandler still O(failed) sequential requests — dismissed: it only runs when mayRunErrorHandler is true and there are failed iterations and none drew a handler on screen; it is sequential, gated to failed iterations, stops at the first hit, and the tradeoff is documented in the PR body.
  • A handler that returned recover: true is never counted — dismissed: it is stored as a success iteration (flow_jobs_success[i] === true), explicitly listed under "Not covered" in the PR body, and opening that iteration shows its handler.

Test coverage

Frontend pure-logic is covered where the codebase expects it: graphBuilder.test.ts pins the handler-edge targets (loop, pass-through branch-one, continuing branch-one, expanded subflow) and the replaced/bypassed edge markings; edgeRunClass.test.ts pins the handler > bypassed > steps precedence. nestedErrorHandlers.ts is I/O-bound and has no sibling test, consistent with the codebase's practice. No Svelte component tests are expected, and no backend/CI/docs changes are in scope.

Manual verification

The PR's test plan reports real-run checks for every row of the semantics table plus the count labels and the retry+handler menu. The one combination not in the screenshots or the new tests remains a failed step inside a branch-one nested in a for-loop with no continue_on_error: on a finished run, select that iteration and confirm the dashed red handler edge reaches <loop>-end (not Result), and that the loop-end → next edge fades while the handler's own edge stays plain. Separately, on a collapsed subflow that both retried steps and ran a handler, confirm the combined ⟳/bug button opens a two-entry menu and each entry expands the subflow.

No blocking issues found.

@Guilhem-lm

Copy link
Copy Markdown
Contributor

✅ Review round clean @ 4f60e55 — nit-only verdicts at 4f60e55; nits addressed / dismissed in review replies (#12516 (comment))

@Guilhem-lm
Guilhem-lm marked this pull request as ready for review November 20, 2026 16:07
@claude

claude Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @Guilhem-lm's task in 34s —— View job


Good to merge

Review: PR #12516 (sixth pass, ready for review)

  • Gather context: the head is still 4f60e55, the commit my fifth pass reviewed. No code has changed since then.
  • Check what came out of the last round
  • Post review

Findings

I found no P0, P1 or P2 issues.

The one open nit is resolved. Last pass I raised a P2: an iteration can run a handler and still succeed, either through a branch-one with continue_on_error or through recover: true. Both the subflow count and the loop label miss that handler.

  • @Guilhem-lm replied that the filter stays on purpose. Walking successful iterations brings back the per-iteration fan-out the filter exists to avoid.
  • The PR description now lists this case under "Not covered".
  • I agree with that trade-off and am not raising it again.

Earlier fixes, unchanged at this head:

  • The walk only starts when a handler can run (mayRunErrorHandler, and the early return in countIn).
  • All walks share 4 request slots.
  • Only failed iterations and branches are walked.
  • The count key covers finished steps only, so a poll does not start a new walk.
  • A walk that failed is dropped from the cache.
  • A loop that fails as a whole has its -end exit marked bypassed.
  • Handler edges are never faded.

AGENTS.md compliance

No changes since the last pass. The comments state constraints rather than narrate, the UI uses Button and DropdownV2 with no deprecated props, and nothing new is exported beyond graph-internal helpers.

Test coverage

  • Frontend pure logic:
    • graphBuilder.test.ts pins:
      • where the handler's edge goes: a loop, a branch-one passing its result on, a branch-one with continue on error, and an expanded subflow
      • the replaced and bypassed exits
    • edgeRunClass.test.ts pins the precedence order in edgeRunClass.
    • These are the right guards. nestedErrorHandlers.ts does I/O, so no test is expected for it, and the Svelte components need none.
  • Not run: I did not run vitest or npm run check here.

Manual check: open a finished run with a collapsed subflow in which one step was retried and an error handler ran. Below the subflow, the retry count should appear right away and the bug count once the walk finishes. The menu should list both entries, and each should expand the subflow. Also look at the dashed paths that did not run in dark mode, which the screenshots don't cover.

@github-actions

Copy link
Copy Markdown
Contributor

Codex Review

Good to merge

No new issues found in the exact base-to-head diff. Earlier findings are addressed, and the documented successful-iteration counting limit matches the accepted review decision.

Test coverage

Exact-head, dependency-mocked checks passed for all six builder/edge regression cases, run-state classification, counting, caching, failure recovery, request concurrency, and iteration selection. git diff --check passed. Focused Vitest could not start because frontend dependencies are absent.

I did not independently exercise the browser. Confirm the combined retry/handler menu expands the subflow from either entry, and that handler destinations and dashed skipped paths render correctly in both themes.

@rubenfiszel
rubenfiszel merged commit 6ec19f0 into main Nov 20, 2026
39 of 40 checks passed
@rubenfiszel
rubenfiszel deleted the flow-graph-error-handler-result-edge branch November 20, 2026 16:13
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants