Skip to content

Fix client regressions for null responses and websocket env URLs#3340

Open
redactdeveloper wants to merge 1 commit into
openai:mainfrom
redactdeveloper:fix/responses-proxy-websocket-azure-regressions
Open

Fix client regressions for null responses and websocket env URLs#3340
redactdeveloper wants to merge 1 commit into
openai:mainfrom
redactdeveloper:fix/responses-proxy-websocket-azure-regressions

Conversation

@redactdeveloper
Copy link
Copy Markdown

@redactdeveloper redactdeveloper commented May 31, 2026

Summary

  • handle Responses API output: null in response parsing, output_text, parsed output helpers, and streaming completion fallback by using the accumulated snapshot when available
  • normalize newline-delimited NO_PROXY / no_proxy values while constructing default httpx clients, restoring the original environment after initialization
  • preserve websocket URL query parameters while changing only the URL scheme/path for realtime and responses websocket managers
  • preserve Azure AD bearer/JWT token compatibility when legacy callers pass AAD tokens via api_key, while keeping normal Azure API keys as api-key

Tests

  • .venv/bin/python -m pytest -o addopts="" tests/lib/responses/test_responses.py tests/lib/test_azure.py tests/test_websocket_urls.py
  • .venv/bin/python -m pytest -o addopts="" tests/test_client.py -k "proxy_environment_variables"
  • .venv/bin/python -m ruff check src/openai/_base_client.py src/openai/lib/_parsing/_responses.py src/openai/lib/streaming/responses/_responses.py src/openai/lib/azure.py src/openai/resources/responses/responses.py src/openai/resources/realtime/realtime.py src/openai/resources/beta/realtime/realtime.py src/openai/types/responses/response.py src/openai/types/responses/parsed_response.py tests/lib/responses/test_responses.py tests/lib/test_azure.py tests/test_client.py tests/test_websocket_urls.py
  • .venv/bin/python -m py_compile src/openai/_base_client.py src/openai/lib/_parsing/_responses.py src/openai/lib/streaming/responses/_responses.py src/openai/lib/azure.py src/openai/resources/responses/responses.py src/openai/resources/realtime/realtime.py src/openai/resources/beta/realtime/realtime.py src/openai/types/responses/response.py src/openai/types/responses/parsed_response.py tests/lib/responses/test_responses.py tests/lib/test_azure.py tests/test_client.py tests/test_websocket_urls.py
  • git diff --check

@redactdeveloper redactdeveloper requested a review from a team as a code owner May 31, 2026 23:04
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd9105e077

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

if output.type == "function_call":
output.arguments += event.delta
elif event.type == "response.completed":
response = snapshot if event.response.output is None else event.response
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve completed stream metadata when output is null

When a streamed response.completed event has output: null, this replaces the final event response with the earlier snapshot. That keeps accumulated output text, but it also drops final-only fields from the completed event such as status, usage, errors/incomplete details, etc., so consumers of response.completed.response can see an in_progress/metadata-less response even though the server sent completed metadata. In this null-output scenario, merge the snapshot output into event.response instead of discarding the completed response object.

Useful? React with 👍 / 👎.

@redactdeveloper redactdeveloper force-pushed the fix/responses-proxy-websocket-azure-regressions branch from cd9105e to d425c9c Compare May 31, 2026 23:11
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.

1 participant