Skip to content

fix(openai): improve websocket retry handling#29645

Open
timrichardson wants to merge 1 commit into
anomalyco:devfrom
timrichardson:fix/openai-websocket-retry-boundary
Open

fix(openai): improve websocket retry handling#29645
timrichardson wants to merge 1 commit into
anomalyco:devfrom
timrichardson:fix/openai-websocket-retry-boundary

Conversation

@timrichardson
Copy link
Copy Markdown

@timrichardson timrichardson commented May 28, 2026

Issue for this PR

Closes #29646

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Handles transient OpenAI Responses websocket failures before response.completed. The websocket pool now retries over HTTP when the socket times out or disconnects before committed output, and avoids replay once output has been emitted.

It also adds deterministic websocket tests for connect timeout, idle timeout, unexpected close, and replay-safe preamble cases.

How did you verify your code works?

  • bun test test/plugin/openai-ws.test.ts
  • bun turbo typecheck via the push hook

Screenshots / recordings

Not applicable; this is error and retry handling with a text retry notice.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@github-actions github-actions Bot added needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels May 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, here are potential duplicate or related PRs:

Most Relevant:

Also Related:

These PRs appear to be addressing related infrastructure around WebSocket connections and retry logic. PR #29394 in particular may be the feature that this PR is fixing.

@github-actions github-actions Bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels May 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

OpenAI websocket disconnects before completion should retry safely

1 participant