Commit 5db9e90
committed
🤖 fix: run forked task tool calls in parallel again
Exempt only provably-isolated `task` tool calls from the per-stream
sequential-execution mutex, restoring parallel sub-agent launches without
reintroducing shared-working-tree races.
#2906 serializes every sibling tool execute() in a stream behind one mutex
to prevent races on shared mutable state. That also serializes parallel
`task` launches: only the first runs, the rest block on the long
foreground waitForAgentReport.
A forking `task` runs in its own isolated checkout and shares no mutable
state with sibling tools, so it is safe to run in parallel. But a `task`
that runs in the PARENT checkout (local runtime, or worktree/ssh with
isolation:"none") shares the working tree and must stay serialized.
Decide per call, by runtime mode + isolation arg, via the new
taskCallSharesParentWorkspace() helper. runtimeMode is threaded
(optionally, defaulting to serialize) from the AIService send path into
the stream-request builder. All other tools remain fully serialized.1 parent ec3314e commit 5db9e90
6 files changed
Lines changed: 359 additions & 21 deletions
File tree
- src
- common/types
- node/services
- tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
24 | 38 | | |
25 | 39 | | |
26 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
50 | 70 | | |
51 | 71 | | |
52 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2671 | 2671 | | |
2672 | 2672 | | |
2673 | 2673 | | |
2674 | | - | |
| 2674 | + | |
| 2675 | + | |
2675 | 2676 | | |
2676 | 2677 | | |
2677 | 2678 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
488 | 489 | | |
489 | 490 | | |
490 | 491 | | |
| 492 | + | |
491 | 493 | | |
492 | 494 | | |
493 | 495 | | |
| |||
1288 | 1290 | | |
1289 | 1291 | | |
1290 | 1292 | | |
1291 | | - | |
| 1293 | + | |
| 1294 | + | |
1292 | 1295 | | |
1293 | 1296 | | |
1294 | 1297 | | |
| |||
1335 | 1338 | | |
1336 | 1339 | | |
1337 | 1340 | | |
1338 | | - | |
| 1341 | + | |
1339 | 1342 | | |
1340 | 1343 | | |
1341 | 1344 | | |
| |||
1469 | 1472 | | |
1470 | 1473 | | |
1471 | 1474 | | |
1472 | | - | |
| 1475 | + | |
| 1476 | + | |
1473 | 1477 | | |
1474 | 1478 | | |
1475 | 1479 | | |
| |||
1489 | 1493 | | |
1490 | 1494 | | |
1491 | 1495 | | |
1492 | | - | |
| 1496 | + | |
| 1497 | + | |
1493 | 1498 | | |
1494 | 1499 | | |
1495 | 1500 | | |
| |||
1517 | 1522 | | |
1518 | 1523 | | |
1519 | 1524 | | |
| 1525 | + | |
1520 | 1526 | | |
1521 | 1527 | | |
1522 | 1528 | | |
| |||
2133 | 2139 | | |
2134 | 2140 | | |
2135 | 2141 | | |
2136 | | - | |
| 2142 | + | |
| 2143 | + | |
2137 | 2144 | | |
2138 | 2145 | | |
2139 | 2146 | | |
| |||
3527 | 3534 | | |
3528 | 3535 | | |
3529 | 3536 | | |
3530 | | - | |
| 3537 | + | |
| 3538 | + | |
3531 | 3539 | | |
3532 | 3540 | | |
3533 | 3541 | | |
| |||
3610 | 3618 | | |
3611 | 3619 | | |
3612 | 3620 | | |
3613 | | - | |
| 3621 | + | |
| 3622 | + | |
3614 | 3623 | | |
3615 | 3624 | | |
3616 | 3625 | | |
| |||
0 commit comments