Repository navigation
Commit 21b2972
authored
fix(mothership): report a browser-claimed workflow tool from its settled execution (#8481)
* fix(mothership): report a browser-claimed workflow tool from its settled execution
When a browser claims a Chat workflow tool, the execute route runs the
workflow and keeps running it after the browser detaches, but only the
browser's confirmation completed the tool call. A tab that closed, lost its
network, or dropped its pagehide beacon left the Chat turn waiting for the
full client wait while the worker swept the call.
The execute route now records the bound execution's structural completion
itself once it settles, guarded on the call still running under that
execution's claim, so a browser report or background detach that lands first
is kept and nothing is delivered twice.
* fix(mothership): report queued async runs and pre-log failures of a browser-claimed workflow tool
* refactor(mothership): settle a browser-claimed workflow tool from its log status alone
* test(mothership): prove a losing settlement report publishes no confirmation1 parent 2178d6e commit 21b2972
6 files changed
Lines changed: 476 additions & 2 deletions
File tree
- apps/sim
- app/api/workflows/[id]/execute
- lib
- mothership
- async-runs
- request/tools
- workflows/executor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
| |||
509 | 513 | | |
510 | 514 | | |
511 | 515 | | |
| 516 | + | |
512 | 517 | | |
513 | 518 | | |
514 | 519 | | |
515 | 520 | | |
516 | 521 | | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
517 | 535 | | |
518 | 536 | | |
519 | 537 | | |
| |||
1297 | 1315 | | |
1298 | 1316 | | |
1299 | 1317 | | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
1300 | 1331 | | |
1301 | 1332 | | |
1302 | 1333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1216 | 1216 | | |
1217 | 1217 | | |
1218 | 1218 | | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
1219 | 1234 | | |
1220 | 1235 | | |
1221 | 1236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
0 commit comments