Repository navigation
feat: lead the run graph's error handler to the node that receives its output - #12516
Conversation
…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>
|
/review |
|
Claude finished @hugocasa's task in 53s —— View job Good to merge Review: PR #12516
FindingsI found no P0, P1 or P2 issues. What I checked:
AGENTS.md compliance
Test coverage
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. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ound the column Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying windmill with
|
| 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 |
…ton' into flow-graph-error-handler-result-edge
|
/review |
|
Claude finished @hugocasa's task in 1m 0s —— View job Good to merge Review: PR #12516 (second pass)
FindingsI found no P0, P1 or P2 issues. What changed since the last review
Checks I repeated on the current head
AGENTS.md compliance
Test coverage
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 |
Codex ReviewGood 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 coverageThe 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. |
Pi ReviewGood to merge This PR threads a What I verified:
Test coverage: 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 Considered and dismissed
|
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>
|
/review |
Codex Reviewcc @hugocasa Should address issues before merging: eager handler-count fetches, cached descendant failures
Test coverageThe 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- 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. |
Pi Reviewcc @hugocasa Should address issues before merging: unbounded per-iteration P1 —
|
… at a time Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/review |
|
Claude finished @Guilhem-lm's task in 1m 24s —— View job cc @hugocasa Review: PR #12516 (fourth pass)
FindingsP2: a collapsed subflow still walks every iteration (
Earlier findings, now addressed
AGENTS.md compliance
Test coverage
Manual checks:
|
| const children: string[] = [] | ||
| for (const mod of status.modules) { | ||
| if (mod.flow_jobs?.length) { | ||
| children.push(...mod.flow_jobs) |
There was a problem hiding this comment.
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.
Codex Reviewcc @hugocasa Should address issues before merging: terminal approval detail returns HTTP 400
Test coverageBackend 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 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. |
Pi ReviewGood to merge I reviewed the three PR commits ( Considered and dismissed
Test coverage
Manual verificationThe 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, |
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
…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
|
/review |
|
Claude finished @Guilhem-lm's task in 1m 31s —— View job cc @hugocasa Review: PR #12516 (fifth pass)
FindingsP2: handlers that ran inside a successful iteration are not counted (
What changed since my last pass, and checks I made
AGENTS.md compliance
Test coverage
Manual checks:
|
| 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)) |
There was a problem hiding this comment.
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_errorbranch-one. You can tell that fromraw_flowwithout a request. - Or add this case to the PR's "Not covered" list next to
recover: true.
There was a problem hiding this comment.
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.
Codex ReviewGood 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 coverageThe 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. 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. |
Pi ReviewGood to merge Reviewed the full diff (base Considered and dismissed
Test coverageFrontend pure-logic is covered where the codebase expects it: Manual verificationThe 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 No blocking issues found. |
|
✅ Review round clean @ 4f60e55 — nit-only verdicts at 4f60e55; nits addressed / dismissed in review replies (#12516 (comment)) |
|
Claude finished @Guilhem-lm's task in 34s —— View job Good to merge Review: PR #12516 (sixth pass, ready for review)
FindingsI 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
Earlier fixes, unchanged at this head:
AGENTS.md complianceNo changes since the last pass. The comments state constraints rather than narrate, the UI uses Test coverage
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. |
Codex ReviewGood 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 coverageExact-head, dependency-mocked checks passed for all six builder/edge regression cases, run-state classification, counting, caching, failure recovery, request concurrency, and iteration selection. 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. |
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:
Where the handler's output goes was checked on real runs and in
worker_flow.rs(payload_from_modulesgives each loop iteration, branch-all branch and branch-one branch its own inner flow job with a copy of the handler, andhas_triggered_error_handlerkeeps outer levels from running it again):<loop>-end<branchall>-end<branchone>-endChanges
processModulesthreads ahandlerTargetdown the structure tree and records it per step; the marker block draws the edge to it.edges, not throughaddEdge, so it stays out ofparents: the compound layout groups nodes by walkingparents, and an edge from inside a branch-one to Result pulled Result into the branch's group.bypassed, dashed, and hidden when it leads to the node the handler's edge leads to.edgeRunClass.ts), not baked into edgedata, 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, andbypassed.FlowStatusViewerInnerpassesrunDonetoFlowGraphV2, which sets it on the run-status context (didNotRun).FlowModuleSchemaItemtoModuleNode, next to the handler count, so the two can share one line and one menu (DropdownV2).nestedErrorHandlers.ts) walks the run's job tree from the frontend: a handler ran when a flow job'sflow_status.failure_module.jobis set. No server endpoint lists every job under a run (parent_jobonly matches direct children), so the walk is kept small:mayRunErrorHandler).Not covered:
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.Failure, but the run viewer draws it without a state, so the edge into it is dashed as not run.Demo
1795189627-eh-demo.mp4
Screenshots
Before is the released UI (v1.858.0), after is this branch, on the same runs.
recover: trueTest plan
graphBuilder.test.ts: handler edge targetsloop-end, Result through a branch-one,<branchone>-endfor a continuing branch-one,sub-subflow-endin an expanded subflow; a failed last step's exit isreplaced, a whole-loop failure'sloop-endexit isbypassededgeRunClass.test.ts: a handler's edge stays plain next to a step that did not run; replaced, bypassed and not-run edgesnpm run check:fast: only the 4 errors main already has; vitest onsrc/lib/components/graph: 39 passed🤖 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
<loop>-endor<branchall>-end.<branchone>-endwhen the branch continues on error.Run painting
parentsso the layout doesn't pull Result into a branch group; the failed step keeps its structural edge so the steps after it stay attached.Written for commit 4f60e55. Summary will update on new commits.