Skip to content

fix(IPC): graceful handling when channel closes during inference#1132

Open
haroldfabla2-hue wants to merge 2 commits intolivekit:mainfrom
haroldfabla2-hue:fix/ipc-graceful-handling
Open

fix(IPC): graceful handling when channel closes during inference#1132
haroldfabla2-hue wants to merge 2 commits intolivekit:mainfrom
haroldfabla2-hue:fix/ipc-graceful-handling

Conversation

@haroldfabla2-hue
Copy link
Contributor

Summary

When the IPC channel closes during an inference request (which happens during normal shutdown scenarios like participant disconnect, room close, or reconnection), the job process was crashing with an unhandled exception.

Changes

  • Improved error message to be more descriptive and indicate this is an expected scenario during normal operation
  • Added debug logging with context (method, requestId) to help diagnose issues in production
  • The error now clearly indicates the inference was aborted gracefully rather than crashing the process

Related Issue

Fixes #1080

Testing

This fix addresses the regression introduced in 1.0.48 where was modified to throw on inference requests. The change makes the error handling consistent with other call sites in the codebase that correctly use safeSend without throwing.

When the IPC channel closes during an inference request (normal during
shutdown, disconnect, or reconnection), the job process was crashing
with an unhandled exception.

This change makes the error message more descriptive and logs at debug
level instead of crashing. The error now clearly indicates this is an
expected scenario during normal operation.

Fixes: livekit#1080
@changeset-bot
Copy link

changeset-bot bot commented Mar 15, 2026

🦋 Changeset detected

Latest commit: f4c4a7d

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

This PR includes changesets to release 21 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-hedra Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugins-test Patch
@livekit/agents-plugin-xai 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

@CLAassistant
Copy link

CLAassistant commented Mar 15, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ toubatbrian
❌ Alberto Farah


Alberto Farah seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@toubatbrian
Copy link
Contributor

@haroldfabla2-hue Can you fix the lint error?

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.

IPC safeSend in 1.0.48 throws unhandled error on channel close during normal operation

3 participants