Skip to content

fix: avoid retrying aborted LLM requests during shutdown#1247

Merged
toubatbrian merged 2 commits intolivekit:mainfrom
tobiplancraft:fix-llm-abort-during-shutdown
Apr 15, 2026
Merged

fix: avoid retrying aborted LLM requests during shutdown#1247
toubatbrian merged 2 commits intolivekit:mainfrom
tobiplancraft:fix-llm-abort-during-shutdown

Conversation

@tobiplancraft
Copy link
Copy Markdown
Contributor

Summary

  • treat already-aborted inference LLM streams as expected cancellation after request creation
  • return early for aborted streams in the error path so shutdown does not reclassify cancellation as a retryable API failure
  • prevent noisy retry logs when a participant disconnect aborts an in-flight goodbye generation

Test plan

  • Reproduce the bug locally with a modified manual_shutdown.ts end-call flow
  • Build @livekit/agents
  • Verify the fix removes retry spam for aborted LLM requests during session shutdown

Fixes #1245

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 14, 2026

🦋 Changeset detected

Latest commit: 3575d25

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

This PR includes changesets to release 24 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-assemblyai 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-mistral 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-trugen 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
Copy Markdown

CLAassistant commented Apr 14, 2026

CLA assistant check
All committers have signed the CLA.

@tobiplancraft tobiplancraft marked this pull request as draft April 14, 2026 10:49
Treat aborted inference LLM streams as expected cancellation so session shutdown does not reclassify them as retryable failures and trigger noisy retries.
@tobiplancraft tobiplancraft force-pushed the fix-llm-abort-during-shutdown branch from 5387765 to fb6d433 Compare April 14, 2026 10:51
@tobiplancraft tobiplancraft marked this pull request as ready for review April 14, 2026 10:52
Copy link
Copy Markdown
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 2 additional findings.

Open in Devin Review

@toubatbrian toubatbrian merged commit c639206 into livekit:main Apr 15, 2026
5 of 6 checks passed
@tobiplancraft tobiplancraft deleted the fix-llm-abort-during-shutdown branch April 16, 2026 06:59
@github-actions github-actions Bot mentioned this pull request Apr 15, 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.

LLM request abort during session shutdown is treated as retryable and retried

3 participants