Skip to content

Kill the forked agent run if it outlives runtimeout - #642

Open
silug wants to merge 1 commit into
OpenVoxProject:mainfrom
silug:agent-child-run-deadline
Open

Kill the forked agent run if it outlives runtimeout#642
silug wants to merge 1 commit into
OpenVoxProject:mainfrom
silug:agent-child-run-deadline

Conversation

@silug

@silug silug commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Short description

The daemon forks a child for each catalog run and waited on it with a bare Process.waitpid2. The child enforces runtimeout on its own run, but nothing guaranteed that it would actually exit afterwards: a stranded thread or hung subprocess left the parent blocked forever and the agent stopped checking in until the service was restarted.

Poll the child with WNOHANG and, once runtimeout plus a grace period for sending the report has elapsed, SIGKILL it and reap it so the daemon carries on with its schedule. A runtimeout of 0 keeps the old blocking behaviour.

Fixes part of #485

Generated by Claude Code

Checklist

I have:

The daemon forks a child for each catalog run and waited on it with a
bare `Process.waitpid2`. The child enforces `runtimeout` on its own run,
but nothing guaranteed that it would actually exit afterwards: a stranded
thread or hung subprocess left the parent blocked forever and the agent
stopped checking in until the service was restarted.

Poll the child with `WNOHANG` and, once `runtimeout` plus a grace period
for sending the report has elapsed, SIGKILL it and reap it so the daemon
carries on with its schedule. A `runtimeout` of 0 keeps the old blocking
behaviour.

Fixes part of OpenVoxProject#485

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Steven Pritchard <steven.pritchard@gmail.com>
@silug
silug marked this pull request as ready for review September 4, 2026 15:58
@silug
silug enabled auto-merge September 4, 2026 15:58
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.

1 participant