Commit adccd34
authored
fix(concurrency-gate): clamp non-finite max to 1 instead of deadlocking (#4580)
createConcurrencyGate(max) fed `max` straight into Math.max(1, max). If
max is NaN or Infinity (e.g. an unguarded env parse like
Number(process.env.DECOPILOT_MAX_CONCURRENT_SUBAGENTS) with a malformed
value), Math.max(1, NaN) is NaN, and `active < NaN` is always false --
every acquire() parks forever, deadlocking all subagent fan-out on that
pod. hosted-run-concurrency.ts already guards its env parse against
this; the shared gate factory itself did not.1 parent 23fd911 commit adccd34
2 files changed
Lines changed: 15 additions & 1 deletion
File tree
- apps/mesh/src/harnesses/decopilot/built-in-tools
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
99 | 109 | | |
100 | 110 | | |
101 | 111 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
0 commit comments