Skip to content

fix(workflows): show cancelled in-flight agents as stopped in run tree - #16215

Merged
iamwhatever merged 1 commit into
mainfrom
fix/16174-run-tree-cancelled-agents
Oct 3, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/16174-run-tree-cancelled-agents

Conversation

@pepmach

@pepmach pepmach commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: After a workflow run is cancelled, the run tree shows the agents that were still working as stopped and the interrupted phase as not completed, instead of a running spinner and a green check.

Cancel a run while a phase has agents in flight and the run tree keeps a spinner on every one of those agents for as long as the run is shown, while the interrupted phase carries a success check. The run header says cancelled; the rows say work is still running and the phase says it completed. The graph mode of the Workflows run panel reads the same run the same wrong way (running chips, phase ok).

Mechanism: _RunContext.agent() records agent_finished only after the agent call returns, and a cancel leaves that call by asyncio.CancelledError, which its except Exception handler does not catch; the wall-clock ceiling cancels the script task, so it leaves agents the same way (a budget ceiling raises BudgetExceeded before agent_started and cannot). The stream therefore ends agent_started x N, run_cancelled, with no finish for the interrupted agents. groupByPhase sets an agent's ok only on agent_finished, and both views rendered ok === undefined as running without looking at the run's status; phaseStatus() returned ok for every terminal status except failed, although its own comment said a cancelled current phase is not ok.

Why it matters

Anyone who cancels a fan-out run (the chat side panel, the Workflows tab, workflow_cancel) is told the opposite of what happened: the tree looks like the run is still consuming agents and that the interrupted phase delivered. That also applies to a run a budget or wall-clock ceiling stops. The record of past runs is read long after the cancel, so the wrong picture persists.

Not a goal

  • Recording a terminal agent_finished (ok=False, error cancelled) in _RunContext.agent() on CancelledError. agent_finished has many readers (runModel.ts, SubagentRunCard.tsx, the graph model, workflows/service.py, the auto-research campaign mode), ok=False would turn a cancelled phase into failed, and the change would have to keep the checkpoint rule and never swallow the cancel. The backend is untouched; the view derives the stopped state from the run status it already has.
  • Any new event type, prop, or backend field.
  • Changing how a run that finishes normally, or fails, renders.
  • The Workflows authoring page's own inline run tree, which maps a run to finished / failed from run.ok and never passes cancelled.

What changed (motivation → approach → change)

Symptom: a cancelled run's in-flight agents spin forever and their phase shows a check. Root cause: the views read "no agent_finished yet" as "still running" regardless of whether the run is over, and phaseStatus() collapsed cancelled into ok.

Approach (design rule): the view derives "stopped" from the run's terminal status, not from a new event. The run status already reaches both views.

  • runModel.ts: two pure helpers. isTerminalRunStatus(status) (anything but the two active states, running and paused) and agentState(row, runStatus): ok === undefined reads as running only while the run is active and as stopped once it is terminal; a recorded ok still reads ok / failed.
  • WorkflowRunTree.tsx: agent rows render from agentState; a stopped agent gets the filled Square stop mark in text-muted (fill="currentColor", the exact rule the chat stop card draws its stopped glyph with; ActivityViewer and SubagentProgressBar draw the same square in outline) with role="img" and an accessible name. phaseStatus() returns a distinct stopped state for a cancelled run's current phase (finished stays ok, failed stays failed), drawn with the same mark; an earlier phase reads stopped too when the run ended while one of its agents was still in flight (pipeline() has no barrier between stages), so a header never shows a check above a stopped row.
  • Accessible name: pages.chat.stopEventCard.stopped ("Stopped", shipped in all 12 languages). It is already the aria-label of the chat's stop card for the same state with the same glyph, so no catalog key is added.
  • planModel.ts / WorkflowRunGraph.tsx: the sibling graph showed the same stale state (traced: actualState returned running for ok === undefined, startedPhaseState returned ok for a cancelled current phase). Fixed the same way: stopped is added to GraphNodeState and GraphPhaseState, node state comes from the shared agentState, every phase the run ended inside reads stopped (the same non-last rule as the tree), and the icons mirror the tree's. A stopped chip keeps a solid border (it ran; dashed means planned).
  • docs/system-specs/modules/workflows.md: the dashboard section now states the rule and names the pinning tests.

A run that finishes normally or fails with every agent accounted for renders byte-identically (see the frames below) and is pinned by tests.

Backwards compatibility

Compatible: no wire shape, event, prop or key changes; two exported union types gain a value (stopped) and module-private graph helpers gain a status parameter.

Removes nothing: the diff adds a state and two pure helpers; no key, function, route or rendered path goes away.

Tests

Red first. website/src/test/WorkflowRunTree.cancelledAgents.test.tsx was written before the fix and run against the unfixed tree (its Round 1 shape; Round 2 adds a ninth case, see Review lanes): 4 of its 8 tests failed, the 4 baseline tests (running, paused, finished-complete, failed-complete) passed, which is what pins "renders exactly as today":

× shows a stopped state, not a spinner, for each agent a cancel interrupted
  AssertionError: expected 2 to be +0 // Object.is equality      (L64: expect(spinners(container)).toBe(0))
× does not put a success check on the phase the cancel interrupted
  AssertionError: expected 1 to be +0 // Object.is equality      (L80: expect(okIcons(interrupted)).toBe(0))
× shows the stopped state for an agent a ceiling cut off, under a failed run
  AssertionError: expected 2 to be +0 // Object.is equality      (L96: expect(spinners(container)).toBe(0))
× names the stopped state in the active language
  TestingLibraryElementError: Unable to find an accessible element with the role "img" and name "Gestoppt"
Tests  4 failed | 4 passed (8)

The graph tests were also run against the unfixed planModel.ts: 6 failed (expected 'ok' to be 'stopped', expected [ 'unknown', 'ran_ok', 'running' ] to deeply equal [ 'unknown', 'ran_ok', 'stopped' ], a spinner found where none may be).

What each locks in:

  • WorkflowRunTree.cancelledAgents.test.tsx
    • cancelled run, agent_started without agent_finished: no .animate-spin anywhere; each interrupted row has role="img" named "Stopped" and no ok icon; the agent that finished before the cancel keeps its check.
    • the interrupted phase header has no ok icon and no spinner, carries the stop mark; the phase the run moved past keeps its check.
    • overlapping phases (Review still has an agent in flight when Verify starts, then a cancel): both headers carry the stop mark and no ok icon; the review that finished keeps its check, the one in flight reads stopped.
    • a failed run (ceiling) with the same stream: no spinner, stopped rows, the phase keeps its failed mark.
    • the accessible name follows the active language (de → "Gestoppt").
    • running and paused runs with the same stream: spinners exactly as before (3), no stop marks.
    • finished and failed runs with complete events: explicit icon assertions per row and per phase (all ok; the failed agent and its phase marked, the rest ok), no spinner, no stop mark.
  • workflowPlanModel.test.ts
    • "a terminal run leaves no phase spinning" keeps its intent and pins the cancelled phase as stopped (was asserting ok); a finished run's current phase stays ok.
    • unfinished agent under cancelled / failed reads stopped; the phase reads stopped on a cancel and failed on a ceiling; running / paused keep running; the same reading applies past an unknown fence.
    • overlapping phases under a cancel: Review (one agent still in flight when Verify started) and Verify both read stopped.
  • WorkflowRunGraph.test.tsx
    • cancelled run: no spinner, the unfinished node has data-node-state="stopped", a solid (not dashed) border and the labelled stop mark; the phase has data-phase-state="stopped" and no ok icon; the finished node keeps ran_ok. The same run while running keeps its spinner.

Gates run from the worktree in Round 1 (Round 2's run is in Review lanes): npx tsc -p tsconfig.app.json clean; npm run lint clean; npm run lint:i18n OK (407 untranslated strings, at or below the baseline); npm run build green; npm run test: jscpd 0 clones, website vitest suite with coverage 2579 files / 43,474 tests passed (1 expected fail, 2 skipped, 0 failed), Electron node:test suite 2392 passed / 0 failed / 3 skipped (after npm ci in website/electron, which the first run lacked); scripts/docs-lint.sh: all documentation checks passed. Lanes skipped in Round 1: scripts/local-gate.py (dry-run selects 319 frontend files, all inside the full npm run test suite that ran, plus 747 backend files only because the spec markdown falls in the backend bucket; no Python changed, so the backend run was skipped); the i18n style tests with I18N_BASE_REF were not run because no catalog value is added. Comment hygiene: check_comment_history.py covers Python only (0 files in scope); the added TS/TSX/markdown lines were swept by hand for history narration, issue or PR numbers and SHAs (none).

Manual verification

Rendered the real WorkflowRunTree and WorkflowRunGraph with a local, uncommitted Vite + Playwright harness (one capture/*.tsx entry on the dev server, headless Chromium at 2x, dark and light; the harness also reads the DOM facts beside each frame). Same run in both scenes: a Plan phase whose agent finished, then a research-fanout phase with four agents of which one finished.

  • cancelled, before: tree 3 spinners, phase states ok, ok; graph 3 running nodes, phases ok, ok.
  • cancelled, after: tree 0 spinners, 4 stop marks each named "Stopped" (3 agents + the interrupted phase), phase Plan still ok; graph 0 spinners, nodes ran_ok, unknown(for), ran_ok, stopped, stopped, stopped, phases ok, stopped.
  • finished, before and after: cmp reports the PNGs byte-identical in both themes (8 ok icons, 0 spinners, 0 stop marks).
  • Round 3 re-rendered the cancelled "after" frames with the filled squares; the DOM facts beside them are unchanged (0 spinners, 4 stop marks named "Stopped", phases ok, stopped), and the finished frames are byte-identical to Round 1's.

Full npm run test (website suite + Electron suite) green on this head; counts in the Tests section.

Screenshots / video

Method: static render of the real components through the local harness above (no pod; a component-level change). Frames carry no hostnames, paths or session keys.

Before (main) After
Dark, run cancelled with three agents in flight Before, dark: spinners on the three interrupted agents and a green check on the interrupted phase After, dark: stop marks on the three interrupted agents and on the interrupted phase; the finished agent and the completed phase keep their checks
Light, same run Before, light: spinners on the three interrupted agents and a green check on the interrupted phase After, light: stop marks on the three interrupted agents and on the interrupted phase

Each frame shows the tree view on top and the graph view below it.

Finished run, after (byte-identical to before in both themes)

Finished run, dark: every agent and phase shows a check, no spinner, no stop mark

Related Issues

Fixes #16174

Pattern harvest

Rule candidate: review-prompt
Pattern: a view that renders "no end event yet" as "still running" without consulting the parent's terminal status; any per-item spinner derived from a missing event should be gated on the container being non-terminal.

Review lanes

Round 1 (1bf4fda7d027): GPT 5.6, Design and First Principles passed with no items. Opus 5 passed with one advisory finding, which Round 2 fixes. UX returned one WATCH item on the shape of the stop mark, held for the owner's decision (below).

Round 2 (23c6a75dc918 on 04b6588096f1): a phase the run ended inside is stopped even when a later phase had started

  • Finding (Opus 5, span 52e60f259d3f, website/src/apps/workflows/WorkflowRunTree.tsx:71): phaseStatus() returned ok for every non-last phase before looking at the run. In the shipped pipeline() pattern (examples/workflows/01_review_changes.py sets phase="Review" / phase="Verify" per call, and dsl.py pins pipeline() as having no barrier between stages) a Verify agent can start while a Review agent is still in flight, so a cancel then leaves Review as a non-last phase holding an unfinished agent: its header drew the success check while its row drew the stop mark, the two-ways reading this change exists to remove. startedPhaseState() in planModel.ts had the same if (!isLast) return 'ok'.
  • Fix: in both functions the non-last branch returns stopped when the run is terminal and one of the phase's agents has no verdict, ok otherwise. The last-phase rule is unchanged (a finished run's current phase is ok, a failed run's is failed, a cancelled run's is stopped), as is the failed short-circuit. The doc comments on both functions and the rule paragraph in docs/system-specs/modules/workflows.md state the exception. No new state, prop or key.
  • Red first: one new case in WorkflowRunTree.cancelledAgents.test.tsx (an OVERLAPPING stream: two Review agents, one finished, Verify started, run cancelled; both headers must carry the stop mark and no ok icon, the in-flight review row reads stopped, the finished one keeps its check) and one in workflowPlanModel.test.ts (both phases stopped). With the two source files reverted to the Round 1 head exactly those two cases fail (AssertionError: expected 1 to be +0 on the Review header's ok icon; expected [ [ 'Review', 'ok' ], …(1) ] to deeply equal [ [ 'Review', 'stopped' ], …(1) ]), 2 failed / 45 passed across the three workflow test files; with the fix all 67 pass.
  • UX WATCH (span 8ad8d863529e): the lane reads the outline Square as ambiguous against a filled stop glyph. The mark is drawn as in Round 1; whether the stop square is filled is a product-shape call for the owner, so nothing changes here and the item is dispositioned once the lane re-reads this head.
  • Gates on the amended commit: npx tsc -p tsconfig.app.json clean; eslint on the four changed TS/TSX files clean; npm run build green; scripts/docs-lint.sh all checks passed; check_comment_history.py against the merge-base passes (no Python in the diff). npm run test: jscpd 0 clones; website vitest suite with coverage 2579 files / 43,476 tests passed (1 expected fail, 2 skipped, 0 failed); Electron node:test suite 2392 passed / 0 failed / 3 skipped. scripts/local-gate.py under the CI-parity interpreter: backend related set of 747 files in two batches. Batch 1: 50280 passed, 168 skipped, 59 failed, every one in a file this diff does not touch and every one failing identically on a detached checkout of the base commit 04b6588096f1 (test_file_explorer_app.py 31, test_design_tweak_backend.py 21, test_design_tweak_devproc.py 3: id sets compared, no difference; the two TestSpecCheckRunsWhereTheGateIsImportable cases of the pipeline skill's contract file, test_mcp_gateway_adopted_daemon_repair.py 1, test_auto_improvement_members.py 1: the same four fail -n0 on the base). The gate stops after a red batch, so batch 2 (test_snapshot_purpose.py, test_snapshot_recovery_link_roots.py) ran by hand with the planner's argv: 27 passed. The frontend related set (319 files) is inside the full suite above.
  • CI on the Round 1 head: Frontend Tests (1) and (2) failed on src/test/SessionActionsMenu.duplicate.test.tsx and src/test/hoverVariantPolicy.test.ts, two files this diff does not touch; both were last changed by fix(website): gate hover so iOS taps land on the first try #14807 (57d71bb54e, main's tip when that run's merge commit was built), which landed on top of fix(sidebar): name the session-row fork action "Fork chat" #16101 and fix(chat): keep floating composer chrome off the transcript and hero #15820 without seeing them, and main's own run on 57d71bb54e fails the same two tests (run 37037258753). fix: repair two frontend tests broken by the hover-gate cross-merge #16210 was the open test-only fix at the time. Coverage Merge, Coverage Gate and PR Readiness were downstream of those two. Not rebased: main has moved 25 commits past the base without touching any file in this diff, and the two red tests come from main itself, so the branch stays on 04b6588096f1 and picks the fix up with its next rebase once fix: repair two frontend tests broken by the hover-gate cross-merge #16210 lands.

Round 3 (5d59797870bc on 9eb318e377eb): filled stop squares, rebased onto the healed main

  • Round 2 lanes on 23c6a75dc918: GPT 5.6, Design, First Principles, UX and Security Scope passed with no items; Opus 5 did not re-print the Round 2 finding and raised one advisory item on the spec paragraph (below).
  • UX WATCH (span 8ad8d863529e, Round 1): the three stop squares (tree row, tree phase header, graph StoppedIcon) are now drawn with fill="currentColor", the exact rule StopEventCard.tsx uses for the stopped glyph whose catalog entry this mark already borrows for its accessible name. No new component or second drawing; the two aria-labels, the role="img" and the text-muted colour are unchanged, so every Round 1 test still passes as written (tree + graph + plan model, 67 tests). The cancelled "after" frames above were re-rendered from the same harness; the finished frames are byte-identical to Round 1's.
  • Opus 5 (span 04f89979fc20, docs/system-specs/modules/workflows.md): fixed. The paragraph this PR added said a cancel or a ceiling leaves the call by CancelledError / BudgetExceeded, "which are not the Exception its handler catches". Checked against the runner: BudgetExceeded is an Exception subclass that escapes through an explicit re-raise, and every place that raises it (AgentCounter.increment, budget.would_exceed(); Budget.charge has no production caller) runs before agent_started is recorded, so a budget ceiling can never leave an agent in flight, as the spec's own order-of-operations bullet already says. The wall-clock ceiling can: it cancels the script task and then records run_failed (where="ceiling"). The paragraph now attributes the orphan solely to CancelledError (operator cancel or the wall-clock ceiling) and states the budget rule; the ceiling test's comment says the same and its fixture error reads run exceeded 600s. Prose and a fixture string only; no behaviour change. The Mechanism paragraph above was corrected the same way.
  • Rebased onto 9eb318e377eb (the merge commit of test(website): update two frontend tests left red on main #16227): main had moved 27 commits past the Round 1 base without touching any file in this diff; the commit's added and removed lines are byte-identical before and after the rebase (474 lines compared). On the rebased tree the three workflow test files and the two healed files (SessionActionsMenu.duplicate.test.tsx, hoverVariantPolicy.test.ts) pass: 5 files, 107 tests.
  • Inherited CI reds: fixed on main by test(website): update two frontend tests left red on main #16227 (9eb318e377, merged 23:31 UTC; tracked in test: hoverVariantPolicy and SessionActionsMenu.duplicate red on main since #14807 #16274), so this head no longer inherits them; fix: repair two frontend tests broken by the hover-gate cross-merge #16210 is superseded.
  • Gates on the amended commit: npm run build (tsc + vite) green; eslint on the four changed TS/TSX files clean; scripts/docs-lint.sh all checks passed; check_comment_history.py against the merge-base passes (no Python in the diff). npm run test on the rebased head: jscpd 0 clones; website vitest suite with coverage 2581 files / 43,556 tests passed (1 expected fail, 2 skipped, 0 failed); Electron node:test suite 2397 passed / 0 failed / 3 skipped. scripts/local-gate.py was not re-run this round: the diff still contains no Python, its backend related set exists only because the spec markdown falls in the backend bucket, and CI runs that surface on the merge ref regardless.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

@pepmach
pepmach requested a review from a team October 2, 2026 17:46
@pepmach
pepmach requested a review from a team as a code owner October 2, 2026 17:46
@pepmach
pepmach requested a review from bolichen97 October 2, 2026 17:46
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 5d59797870bcabd28da546c630573e6ee4e8c6a4 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify the engine never marks a run finished with an agent still unawaited — that last phase would show a check above a stopped row.

[DESIGN-REVIEWED] 5d59797

Description read

[DESCRIPTION-READ] 71d4884e8e1b8995bff4465095a77af81525ee59722c282713d6bcc195cb27e0

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 5d59797870bcabd28da546c630573e6ee4e8c6a4 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 5d59797

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 5d59797870bcabd28da546c630573e6ee4e8c6a4: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

Premise-level review of 5d59797870bcabd28da546c630573e6ee4e8c6a4 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Verify a finished run can never leave an agent without agent_finished: the non-last-phase rule would then mark a completed run's phase stopped.

What this change ships

Inventory (8 items) — 8 justified

Intent: FIX — after cancelling a workflow run, the run tree and graph show interrupted agents as stopped and the interrupted phase as not completed, instead of a spinner and a green check.

  1. Interrupted agents show a stop mark, not a spinner, once the run is terminal (tree) — justified
  2. The phase a cancel interrupted shows a stop mark, not a success check (tree) — justified
  3. An earlier phase the run ended inside (overlapping pipeline stages) reads stopped, not ok — justified
  4. The graph view shows the same stopped states for nodes and phases — justified
  5. Agents a wall-clock ceiling cut off (run failed) read stopped too — justified
  6. The stop mark carries the chat stop card's existing accessible name in 12 languages — justified
  7. Two exported helpers (isTerminalRunStatus, agentState) and a stopped value in two union types — justified
  8. workflows.md states the derivation rule — justified

Evidence checked: the mechanism claim is real (runner.py:479 except Exception cannot catch CancelledError, so no agent_finished is recorded); the rewritten test pin (cancelled → 'ok') was contradicted by the deleted code comment's own words ("cancelled/failed → not ok unless agents ok"), which the description quotes; pages.chat.stopEventCard.stopped exists in all 15 locale files with the same filled Square glyph (grep stopEventCard, 17 files); both helpers have 2–3 real consumers each (grep isTerminalRunStatus|agentState: tree + graph model); the only run statuses are the five in registry.py:28-32, so "anything but running/paused is terminal" holds; all three WorkflowRunTree/WorkflowRunGraph embedders (chat sidebar, progress bar, Workflows page) render through the fixed components, so no sibling view is left unfixed; red-first failures on base are quoted in the description. Not product shape: it restores the behaviour the deleted comment pinned.

[FIRST-PRINCIPLES-REVIEWED] 5d59797

Description read

[DESCRIPTION-READ] d8cdc36a878a72ecd6f237154da2539653f3a041ac85bc443537a62284575c98

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ✅ PASS

UX-level review of 5d59797870bcabd28da546c630573e6ee4e8c6a4 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: PASS

Eyeball the ceiling-failed run once (stopped squares under a red-X phase) — the only new state combination no screenshot shows, pinned only by tests.

[UX-REVIEWED] 5d59797

Description read

[DESCRIPTION-READ] d5fb86a3d8a16fb74970376a790d8b25e6617b25f8efcc219fc0a0e44d20f525

That sha256 names everything this verdict read: the PR description, plus the 8 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

Reviewed 5d59797870bcabd28da546c630573e6ee4e8c6a4 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 5d59797

Verdict parsed from the review's SHA-scoped output markers for commit 5d59797870bcabd28da546c630573e6ee4e8c6a4.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 5d59797870bcabd28da546c630573e6ee4e8c6a4: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 2, 2026
@pepmach

pepmach commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor Author

CI note on 1bf4fda7d027: the two red shards are inherited, not from this diff.

  • Frontend Tests (1): src/test/SessionActionsMenu.duplicate.test.tsx > "renders Duplicate when the row passes a handler, and selecting it calls the handler" (Unable to find an element with the text: Duplicate).
  • Frontend Tests (2): src/test/hoverVariantPolicy.test.ts > "DECORATIVE entry still matches a site: components/WelcomeView.tsx (sm:group-hover:line-clamp-none)" (expected true, got false).

Both files are untouched by this diff, which changes only website/src/apps/workflows/*, its three tests and docs/system-specs/modules/workflows.md, and adds no hover site. Both were last changed by #14807 (57d71bb54e, main's tip when this run's merge commit was built), which landed on top of two changes its branch never saw: #16101 renamed the menu label the first test looks for, and #15820 rewrote the WelcomeView.tsx class the second test's allowlist entry names. Main's own run on 57d71bb54e fails the same two tests (run 37037258753); #16227 is the test-only fix, merged to main as 9eb318e377. Everything else in both shards passes (645/646 files each); Coverage Merge, Coverage Gate and PR Readiness are downstream of these two.

No rerun: the merge commit takes both files from main, so a rerun fails identically. The next push rebases the branch onto the fixed main.

@pepmach
pepmach force-pushed the fix/16174-run-tree-cancelled-agents branch from 1bf4fda to 23c6a75 Compare October 2, 2026 23:02
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 2, 2026
After a workflow run is cancelled, the run tree kept a running spinner
on every agent that was in flight and drew a success check on the
interrupted phase. The runner records no agent_finished for work a
cancel or a ceiling cuts off, and the views read "no finish event" as
"still running" without consulting the run's status; phaseStatus()
returned ok for every terminal status except failed.

Derive the stopped state from the run's terminal status, which both
views already have: an agent with no finish reads as running only while
the run is active and as stopped once it is terminal, drawn with the
Square stop mark the subagent surfaces use and named with the chat stop
card's catalog entry. The current phase of a cancelled run reads as
stopped, never as a success. The graph mode showed the same stale state
and takes the same rule through the shared helper. A run that finishes
or fails with every agent accounted for renders as before, pinned by
tests. Backend untouched.

Fixes #16174
@pepmach
pepmach force-pushed the fix/16174-run-tree-cancelled-agents branch from 23c6a75 to 5d59797 Compare October 3, 2026 01:09
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 3, 2026

@iamwhatever iamwhatever left a comment

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.

Reviewed: view-only fix. Tree and graph share one agentState helper, agents with no finish event in an ended run read as stopped, and a cancel marks the interrupted phase stopped rather than done. Real failures (ok=false) still render red and failed runs keep a red phase; the backend has only five run statuses, so nothing else can fall into stopped. Gap: no test for a failed agent inside a cancelled run, which should stay red.

@iamwhatever
iamwhatever enabled auto-merge (squash) October 3, 2026 06:08
@iamwhatever
iamwhatever merged commit c19de17 into main Oct 3, 2026
140 of 143 checks passed
@iamwhatever
iamwhatever deleted the fix/16174-run-tree-cancelled-agents branch October 3, 2026 06:09
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workflows: after a cancel, agents that were in flight keep a running spinner and the interrupted phase shows a success check

2 participants