Skip to content

Document the WebSocket responses opt-out - #4770

Open
1fanwang wants to merge 2 commits into
github:mainfrom
1fanwang:1fannnw/document-websocket-responses-opt-out
Open

Document the WebSocket responses opt-out#4770
1fanwang wants to merge 2 commits into
github:mainfrom
1fanwang:1fannnw/document-websocket-responses-opt-out

Conversation

@1fanwang

@1fanwang 1fanwang commented Sep 8, 2026

Copy link
Copy Markdown

Why

Models that advertise a WebSocket responses endpoint use it by default. When that transport is unusable, either because the network blocks WebSocket connections or because a session starts failing with 400 input item ID does not belong to this connection, there is a working escape hatch, but nothing user-facing points to it.

COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES is not listed in copilot help environment and is not in the README. The only public description lives in an SDK type comment, which CLI users do not read. People hitting this are left changing models by trial and error, and switching between two models that both use the transport appears to do nothing.

Related: #4505

What changed

A short subsection under Using the CLI naming the variable, the two situations it addresses, and its relationship to the SDK session option.

Testing

Ran the same prompt with and without the variable under --log-level debug, in an isolated home directory, and counted use of the WebSocket responses network module.

Raw logs
$ export COPILOT_HOME=$(mktemp -d)
$ L=$(mktemp -d); L2=$(mktemp -d)

$ copilot --log-level debug --log-dir "$L" --model gpt-5.6-sol -p 'say OK'
$ grep -c 'Opening WebSocket responses connection' "$L"/*.log
1
$ grep -oE 'network::[a-z_]+' "$L"/*.log | sort | uniq -c
   3 network::websocket_responses

$ COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES=true \
    copilot --log-level debug --log-dir "$L2" --model gpt-5.6-sol -p 'say OK'
$ grep -c 'Opening WebSocket responses connection' "$L2"/*.log
0
$ grep -oE 'network::[a-z_]+' "$L2"/*.log | sort | uniq -c
(no matches)

$ copilot help environment | grep -c COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES
0

Repeating the second run with --model gpt-5.6-terra also reported zero
WebSocket responses connections.

Models advertising a WebSocket responses endpoint use it by default, and
the environment variable that falls back to the HTTP transport is not
listed anywhere users can find it. It is the documented recovery for
networks that block WebSocket connections and for sessions that start
failing with a connection-bound input item ID error.

Signed-off-by: 1fanwang <1fannnw@gmail.com>
@1fanwang
1fanwang requested review from a team and a balanced review from Copilot September 8, 2026 15:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Clarify the inverse SDK option and add PowerShell instructions.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Documents disabling WebSocket responses to fall back to HTTP.

Changes:

  • Adds the opt-out environment variable.
  • Explains relevant failure scenarios and SDK configuration.
File summaries
File Description
README.md Documents HTTP fallback configuration for WebSocket response failures.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md
Comment thread README.md Outdated
The README documents Windows support but the workaround only had POSIX
export syntax, and calling it equivalent to the SDK option was ambiguous
because the two have opposite polarity.

Signed-off-by: 1fanwang <1fannnw@gmail.com>
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.

2 participants