Skip to content

Conversation

@Hormold
Copy link
Contributor

@Hormold Hormold commented Dec 26, 2025

Description

Fix supervisor process crashes when child process dies unexpectedly

Changes Made

  • Wrap pidusage() in try-catch, return 0 if process is gone (ENOENT)
  • Check proc.connected before all send() calls to avoid ERR_IPC_CHANNEL_CLOSED
  • Call clearTimers() in exit handler (was only in error handler)
  • Remove throw err after reject(err) in setTimeout (was causing uncaught exception) (not sure here)

Pre-Review Checklist

  • Build passes: All builds (lint, typecheck, tests) pass locally
  • AI-generated code reviewed: Removed unnecessary comments and ensured code quality
  • Changes explained: All changes are properly documented and justified above
  • Scope appropriate: All changes relate to the PR title, or explanations provided for why they're included

Testing

  • Automated tests added/updated (if applicable)
  • All tests pass

Note to reviewers: Please ensure the pre-review checklist is completed before starting your review.

@changeset-bot
Copy link

changeset-bot bot commented Dec 26, 2025

🦋 Changeset detected

Latest commit: 59c7d1a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugins-test Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

- Handle pidusage ENOENT on dead process
- Check proc.connected before send()
- Clear timers on exit
- Remove throw after reject in setTimeout
@Hormold Hormold force-pushed the fix/supervised-proc-crash-on-child-death branch from d01b560 to dff47bd Compare December 26, 2025 21:33
@toubatbrian toubatbrian merged commit 1fa10e1 into main Jan 5, 2026
8 checks passed
@toubatbrian toubatbrian deleted the fix/supervised-proc-crash-on-child-death branch January 5, 2026 08:23
@github-actions github-actions bot mentioned this pull request Jan 5, 2026
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.

3 participants