Skip to content

fix(agent): reset SIGCHLD before spawning process - #871

Merged
HalFrgrd merged 1 commit into
HalFrgrd:masterfrom
reekta92:master
Aug 3, 2026
Merged

HalFrgrd merged 1 commit into
HalFrgrd:masterfrom
reekta92:master

Conversation

@reekta92

@reekta92 reekta92 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Bash executes command substitutions like
which reinstall Bash's own SIGCHLD handler,
overwriting the SIG_DFL set during initialization. This caused Bash to reap agent processes, failing with ECHILD.

  • Reset SIGCHLD to SIG_DFL immediately before
  • Reset SIGCHLD after returns
  • Replace with to guarantee SA_NOCLDWAIT is cleared across all platforms

Related to issue #870

Bash  executes command substitutions like
 which reinstall Bash's own SIGCHLD handler,
overwriting the SIG_DFL set during initialization. This caused
Bash to reap agent processes, failing  with ECHILD.

- Reset SIGCHLD to SIG_DFL immediately before
- Reset SIGCHLD after  returns
- Replace  with  to guarantee
  SA_NOCLDWAIT is cleared across all platforms
@HalFrgrd HalFrgrd linked an issue Aug 3, 2026 that may be closed by this pull request
@HalFrgrd

HalFrgrd commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Thank you! This will also fix: #847

@HalFrgrd
HalFrgrd merged commit bbbf8d3 into HalFrgrd:master Aug 3, 2026
@HalFrgrd

HalFrgrd commented Aug 3, 2026

Copy link
Copy Markdown
Owner

I refactored it a bit to remove duplicate code: 41f06fb.

I also made it panic safe; when flyline panics, I want us to restore the SIGCHLD handler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: AI task failed: No child processes with Custom Prompt

2 participants