Skip to content

fix: avoid retrying aborted LLM requests during shutdown#1247

Open
tobiplancraft wants to merge 1 commit intolivekit:mainfrom
tobiplancraft:fix-llm-abort-during-shutdown
Open

fix: avoid retrying aborted LLM requests during shutdown#1247
tobiplancraft wants to merge 1 commit intolivekit:mainfrom
tobiplancraft:fix-llm-abort-during-shutdown

Conversation

@tobiplancraft
Copy link
Copy Markdown

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

⚠️ No Changeset found

Latest commit: fb6d433

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a 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

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