Commit 778f4a5
authored
* Revert "improvement(executor): correctness-by-construction for workflow logs (#4382)"
This reverts commit add55b4.
* fix(terminal): re-read entries inside reconcileFinalBlockLogs loop
For workflows with loop or parallel iterations, finalBlockLogs can
contain multiple terminal logs sharing the same blockId. The prior
code captured entries once before the loop, so entries.find always
matched the same first running entry — later iterations stayed
isRunning: true and got swept to "cancelled" instead of showing
their actual terminal state. Re-read the snapshot per iteration so
each updateConsole's isRunning: false flush narrows the next match.
* chore(terminal): remove dead consoleMode 'add' branch and helpers
Every callsite passes consoleMode: 'update'. Deletes the field, the
unreachable 'add' branches in onBlockCompleted/onBlockError, and the
addConsoleEntry/addConsoleErrorEntry helpers that only the dead
branch invoked.
* fix(executor): reconcile finalBlockLogs on execution:completed
block:completed callbacks fire-and-forget; the last block's event can
arrive after execution:completed, leaving its console entry stuck
isRunning. Mirror the error/cancelled paths: emit finalBlockLogs on
execution:completed and reconcile + sweep on the client.
* fix(executor): emit finalBlockLogs on queued/HITL error and cancel paths
queued-workflow-execution and human-in-the-loop-manager only attached
finalBlockLogs to execution:completed. Without it on cancel/error,
reconcileFinalBlockLogs is a no-op and the client sweep flips
already-completed blocks to canceled. Mirror the route.ts pattern.
1 parent b0881de commit 778f4a5
16 files changed
Lines changed: 424 additions & 385 deletions
File tree
- apps/sim
- app
- api/workflows/[id]/execute
- workspace/[workspaceId]/w/[workflowId]
- hooks
- utils
- executor
- execution
- lib/workflows/executor
- stores/terminal/console
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
919 | 919 | | |
920 | 920 | | |
921 | 921 | | |
922 | | - | |
923 | | - | |
| 922 | + | |
924 | 923 | | |
925 | 924 | | |
926 | 925 | | |
| |||
946 | 945 | | |
947 | 946 | | |
948 | 947 | | |
949 | | - | |
950 | 948 | | |
951 | 949 | | |
952 | 950 | | |
| |||
957 | 955 | | |
958 | 956 | | |
959 | 957 | | |
960 | | - | |
961 | | - | |
| 958 | + | |
962 | 959 | | |
963 | 960 | | |
964 | 961 | | |
| |||
972 | 969 | | |
973 | 970 | | |
974 | 971 | | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | 972 | | |
981 | 973 | | |
982 | 974 | | |
| |||
1010 | 1002 | | |
1011 | 1003 | | |
1012 | 1004 | | |
1013 | | - | |
1014 | 1005 | | |
1015 | 1006 | | |
1016 | 1007 | | |
| |||
1045 | 1036 | | |
1046 | 1037 | | |
1047 | 1038 | | |
1048 | | - | |
1049 | 1039 | | |
1050 | 1040 | | |
1051 | 1041 | | |
| |||
1175 | 1165 | | |
1176 | 1166 | | |
1177 | 1167 | | |
| 1168 | + | |
1178 | 1169 | | |
1179 | 1170 | | |
1180 | 1171 | | |
| |||
1188 | 1179 | | |
1189 | 1180 | | |
1190 | 1181 | | |
| 1182 | + | |
1191 | 1183 | | |
1192 | 1184 | | |
1193 | 1185 | | |
| |||
1228 | 1220 | | |
1229 | 1221 | | |
1230 | 1222 | | |
| 1223 | + | |
1231 | 1224 | | |
1232 | 1225 | | |
1233 | 1226 | | |
| |||
1252 | 1245 | | |
1253 | 1246 | | |
1254 | 1247 | | |
| 1248 | + | |
1255 | 1249 | | |
1256 | 1250 | | |
1257 | 1251 | | |
| |||
Lines changed: 44 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
| 234 | + | |
233 | 235 | | |
234 | 236 | | |
235 | 237 | | |
236 | | - | |
| 238 | + | |
237 | 239 | | |
238 | 240 | | |
239 | 241 | | |
240 | | - | |
| 242 | + | |
241 | 243 | | |
242 | 244 | | |
243 | 245 | | |
244 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
245 | 252 | | |
246 | 253 | | |
247 | | - | |
| 254 | + | |
248 | 255 | | |
249 | 256 | | |
250 | 257 | | |
251 | | - | |
| 258 | + | |
252 | 259 | | |
253 | 260 | | |
254 | 261 | | |
| |||
1030 | 1037 | | |
1031 | 1038 | | |
1032 | 1039 | | |
| 1040 | + | |
1033 | 1041 | | |
1034 | 1042 | | |
1035 | 1043 | | |
| |||
1123 | 1131 | | |
1124 | 1132 | | |
1125 | 1133 | | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
1126 | 1141 | | |
1127 | 1142 | | |
1128 | 1143 | | |
| |||
1232 | 1247 | | |
1233 | 1248 | | |
1234 | 1249 | | |
| 1250 | + | |
1235 | 1251 | | |
1236 | 1252 | | |
1237 | 1253 | | |
| |||
1258 | 1274 | | |
1259 | 1275 | | |
1260 | 1276 | | |
| 1277 | + | |
1261 | 1278 | | |
1262 | 1279 | | |
1263 | 1280 | | |
| |||
1674 | 1691 | | |
1675 | 1692 | | |
1676 | 1693 | | |
| 1694 | + | |
1677 | 1695 | | |
1678 | 1696 | | |
1679 | 1697 | | |
| |||
1692 | 1710 | | |
1693 | 1711 | | |
1694 | 1712 | | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
1695 | 1721 | | |
1696 | 1722 | | |
1697 | 1723 | | |
| |||
1743 | 1769 | | |
1744 | 1770 | | |
1745 | 1771 | | |
| 1772 | + | |
1746 | 1773 | | |
1747 | 1774 | | |
1748 | 1775 | | |
| |||
1755 | 1782 | | |
1756 | 1783 | | |
1757 | 1784 | | |
| 1785 | + | |
1758 | 1786 | | |
1759 | 1787 | | |
1760 | 1788 | | |
| |||
1901 | 1929 | | |
1902 | 1930 | | |
1903 | 1931 | | |
| 1932 | + | |
1904 | 1933 | | |
1905 | 1934 | | |
1906 | 1935 | | |
| |||
1967 | 1996 | | |
1968 | 1997 | | |
1969 | 1998 | | |
1970 | | - | |
| 1999 | + | |
1971 | 2000 | | |
1972 | 2001 | | |
1973 | 2002 | | |
| |||
1981 | 2010 | | |
1982 | 2011 | | |
1983 | 2012 | | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
1984 | 2020 | | |
1985 | 2021 | | |
1986 | 2022 | | |
| |||
2001 | 2037 | | |
2002 | 2038 | | |
2003 | 2039 | | |
| 2040 | + | |
2004 | 2041 | | |
2005 | 2042 | | |
2006 | 2043 | | |
| |||
2021 | 2058 | | |
2022 | 2059 | | |
2023 | 2060 | | |
| 2061 | + | |
2024 | 2062 | | |
2025 | 2063 | | |
2026 | 2064 | | |
| |||
0 commit comments