You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6181504
Browse filesBrowse the repository at this point in the historyBrowse files
fix(workflow): settle a run's node map when the run is ended (#1424)
A run ended by reap() at load, or by settle()'s dispatch catch, was marked
failed while its nodeStatus still said running for the node the host was on.
publicRun() derives `running` from nodeStatus, so the flow strip kept painting
"Running now" for a run that had ended and was not going to move again.
Both paths now end a run through one helper: the nodes still running become
failed, the run gets one failed line in its history, and updatedAt moves. A run
that already ended keeps its own status and history. A node the graph no longer
has is left as it is rather than thrown, and reap() ends runs one by one so one
bad record cannot leave the rest running.
A run ended at load, or by a step the host refused, kept the nodes it had been running: the run said `failed` while the flow strip still painted "Running now" for that node. Ending a run now marks those nodes `failed` and records one `failed` line in the run's history ([#1424](https://github.com/ThinkFlowLab/FlyBot/issues/1424)).
Copy file name to clipboardExpand all lines: docs/subsystems/workflow.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,8 @@ Everything in `plugins/workflow/`: the graph rules, the run store, the matcher,
49
49
3. Progress lines stay scripted, and a run does not create a schedule. `scheduleLabel` is display text. When the host can create Bots, starting a run (`assign`, `run_workflow`, `ingest`, or a demo that starts or restarts) spawns one ephemeral Bot per node from that node's prompt, role, model and tools, sends it the step from the Main Bot, and removes every instance when the run finishes, fails for good, or is reset. A `failOnce` retry keeps them. They are hidden and left out of the sidebar. Loading the plugin does not spawn Bots for the seeded fixture run.
50
50
51
51
Loading is also the one moment a run the host left behind is noticed: a run still marked `running` is abandoned, so loading releases its instances and records the run as `failed`. Nothing resumes it. A run that already ended keeps its own status (#1388).
52
+
53
+
Ending a run settles its node map with it: every node still marked `running` becomes `failed`, and the run gets one `failed` line in its history. `publicRun().running` is derived from `nodeStatus`, so a run that says `failed` while a node still says `running` is a ghost the strip paints as "Running now". `settle()`'s dispatch catch ends the run the same way, through the same helper (#1424).
52
54
4. Auto-assign considers an `open` card only. First hit wins: a `workflow:` token, then `workflowId` / `workflow`, then an assignee that names a workflow, then a `bot:` token, then an assignee that names a local Bot, then the longest trigger contained in the title, note or criteria. A miss returns no route. A second ingest of the same task and target is a no-op, and a live run for that task id is not restarted.
53
55
5. The browser draws text only. Names and messages are React text children. The unit renderer asserts a hostile name is not markup.
54
56
6.`enabled: false` registers no endpoint, tool or listener and writes nothing.
@@ -57,4 +59,4 @@ Everything in `plugins/workflow/`: the graph rules, the run store, the matcher,
57
59
58
60
## Tests
59
61
60
-
`plugins/workflow/test/`: graph advance and join, graph edit, assign and persistence, templates, `define` / `runNamed`, the matcher, ephemeral spawn and cleanup, the client canvas, the settings page, and a sidebar click that leaves the Workflows section in place. Run `npm test` in `plugins/workflow`. The host seam that applies `ownerBotId` is `core/test/task-route.test.js`. The host omission of run Bots is `core/test/flybot.test.js`.
62
+
`plugins/workflow/test/`: graph advance and join, graph edit, assign and persistence, templates, `define` / `runNamed`, the matcher, ephemeral spawn and cleanup, a reaped run's settled node map (#1424), the client canvas, the settings page, and a sidebar click that leaves the Workflows section in place. Run `npm test` in `plugins/workflow`. The host seam that applies `ownerBotId` is `core/test/task-route.test.js`. The host omission of run Bots is `core/test/flybot.test.js`.
0 commit comments