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
- Start an OpenCode request that uses the OpenAI Responses websocket path.
- 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.
- 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
Description
OpenAI Responses websocket requests can fail when the websocket closes or idles before
response.completed, for example with code1006.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:
and this terminates the response.
Plugins
Not specified in the original report.
OpenCode version
1.15.10
Steps to reproduce
response.completedevent is received, for example with close code1006. This is an intermittent bug and can't be reliably reproduced. In Australia if might be once ever 15 minutes or so.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