Skip to content

OpenAI websocket disconnects before completion should retry safely #29646

Closed as not planned

Description

@timrichardson

Description

OpenAI Responses websocket requests can fail when the websocket closes or idles before response.completed, for example with code 1006.

If no response output has been committed yet, this transient websocket failure should retry over HTTP instead of surfacing to the user. Once output has been emitted, it should not replay because that can duplicate partial responses.

this model for correct behaviour is the SSE workaround, which retries and gives feedback to the user via a transitory message in the terminal.

Observed error:

WebSocket closed before response.completed (code 1006: Connection ended)

and this terminates the response.

Plugins

Not specified in the original report.

OpenCode version

1.15.10

Steps to reproduce

  1. Start an OpenCode request that uses the OpenAI Responses websocket path.
  2. Have the websocket close or idle before a response.completed event is received, for example with close code 1006. This is an intermittent bug and can't be reliably reproduced. In Australia if might be once ever 15 minutes or so.
  3. Response stops.

exepected behaviour:
OpenCode retries and the response continues. User is informed of a timeout and retry.

Screenshot and/or share link

Not available.

Operating System

ubuntu

Terminal

ghostty

Activity

  1. added
    needs:complianceThis means the issue will auto-close after 2 hours.
    and removed
    needs:complianceThis means the issue will auto-close after 2 hours.
    on May 28, 2026
  2. github-actions commented on May 28, 2026

    @github-actions
    Contributor

    Thanks for updating the issue! It now meets the contributing guidelines and has been marked as compliant.

  3. github-actions commented on Jul 28, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions