Repository navigation
Commit 2295914
committed
fix(opencode): use exit event instead of close to resolve bash tool hang
When a bash command spawns a background child process (e.g. `npm run
build &`), the shell exits immediately but Node's `close` event
won't fire until the background process also closes its inherited
stdout/stderr pipe descriptors. This causes the bash tool to hang
indefinitely (until the 2-minute timeout).
Fix: resolve the spawn promise on the `exit` event instead of
`close`. The `exit` event fires as soon as the spawned process
terminates, regardless of inherited pipe descriptors.
Fixes anomalyco#209021 parent f39b9c0 commit 2295914
1 file changed
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | 275 | | |
279 | 276 | | |
280 | | - | |
| 277 | + | |
| 278 | + | |
281 | 279 | | |
282 | 280 | | |
283 | 281 | | |
| |||
0 commit comments