From 275f5d2d903d2a10f8af93742360b06f78f78bb4 Mon Sep 17 00:00:00 2001 From: Junhyuk Lee Date: Thu, 30 Apr 2026 07:44:25 +0000 Subject: [PATCH 1/4] Advance OSS contribution for chat.completions does not work with `verbosity` param Nightly Codex produced a focused contribution for https://github.com/openai/openai-python/issues/2610. Constraint: Automated nightly run; keep changes small and reviewable. Confidence: medium Scope-risk: narrow Tested: See uploaded nightly artifacts and workflow logs. Not-tested: Maintainer CI beyond this workflow. --- .codex-nightly-retry-1.md | 13 +++++++++++++ NIGHTLY_CODEX_FINAL_ATTEMPT_1.md | 8 ++++++++ NIGHTLY_CODEX_FINAL_ATTEMPT_2.md | 14 ++++++++++++++ tests/test_client.py | 20 ++++++++++++++++++++ 4 files changed, 55 insertions(+) create mode 100644 .codex-nightly-retry-1.md create mode 100644 NIGHTLY_CODEX_FINAL_ATTEMPT_1.md create mode 100644 NIGHTLY_CODEX_FINAL_ATTEMPT_2.md diff --git a/.codex-nightly-retry-1.md b/.codex-nightly-retry-1.md new file mode 100644 index 0000000000..95d75f4e57 --- /dev/null +++ b/.codex-nightly-retry-1.md @@ -0,0 +1,13 @@ +The previous attempt produced no source, test, docs, or example changes. + +Continue working. A successful nightly slot must produce a small, honest, +maintainer-reviewable PR unless the repository is technically impossible +to patch for this target. + +Requirements for this retry: +- Search the local repository for a directly related patch surface. +- Prefer a focused test, docs/example correction, typing/schema fix, CLI behavior fix, or small error-handling improvement. +- If the exact upstream symptom is server-side, produce a repository-local improvement that prevents user confusion or locks existing behavior without falsely claiming to fix the server. +- Do not stop with only NIGHTLY_REPORT.md. +- Modify at least one tracked source, test, docs, or example file if a defensible PR exists. +- Keep the diff small and explain the rationale in NIGHTLY_REPORT.md. diff --git a/NIGHTLY_CODEX_FINAL_ATTEMPT_1.md b/NIGHTLY_CODEX_FINAL_ATTEMPT_1.md new file mode 100644 index 0000000000..cede1090c4 --- /dev/null +++ b/NIGHTLY_CODEX_FINAL_ATTEMPT_1.md @@ -0,0 +1,8 @@ +Investigated issue #2610 and stopped without a source/test diff because the checkout already fixes the SDK-side bug: `verbosity` is accepted by `chat.completions.create()` and is serialized as a top-level request body field. + +I added [NIGHTLY_REPORT.md](/home/runner/work/oss-nightly-control/oss-nightly-control/target/NIGHTLY_REPORT.md) with the investigation, verification, failed pytest attempts, and remaining risk. + +Verification run: +`client.chat.completions.create(..., verbosity="low")` produced request JSON containing `"verbosity": "low"`. + +Tests could not run because `pytest` is not installed in the available Python/venv/uv environment. Source: GitHub issue https://github.com/openai/openai-python/issues/2610. \ No newline at end of file diff --git a/NIGHTLY_CODEX_FINAL_ATTEMPT_2.md b/NIGHTLY_CODEX_FINAL_ATTEMPT_2.md new file mode 100644 index 0000000000..2b6810c74b --- /dev/null +++ b/NIGHTLY_CODEX_FINAL_ATTEMPT_2.md @@ -0,0 +1,14 @@ +Implemented a small, issue-related test change. + +Changed [tests/test_client.py](/home/runner/work/oss-nightly-control/oss-nightly-control/target/tests/test_client.py:949) to add a focused regression test that calls `chat.completions.with_raw_response.create(..., verbosity="low")` and asserts the request body sends `verbosity` as a top-level `/chat/completions` field, not nested under `text`. + +Updated [NIGHTLY_REPORT.md](/home/runner/work/oss-nightly-control/oss-nightly-control/target/NIGHTLY_REPORT.md:1) with the rationale, verification, and test limitations. + +Verification: +- Passed a direct `uv run python` serialization check showing: + `{"messages": [{"content": "string", "role": "developer"}], "model": "gpt-5.4", "verbosity": "low"}` + +Could not run pytest locally because: +- system Python has no `pytest` +- `uv run python -m pytest ...` has no `pytest` +- `scripts/test ...` requires `rye`, which is not installed here. \ No newline at end of file diff --git a/tests/test_client.py b/tests/test_client.py index 570042c46a..f8cc92217f 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -946,6 +946,26 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client ).__enter__() assert _get_open_connections(client) == 0 + @pytest.mark.respx(base_url=base_url) + def test_chat_completions_verbosity_is_serialized(self, respx_mock: MockRouter, client: OpenAI) -> None: + respx_mock.post("/chat/completions").mock(return_value=httpx.Response(200, json={})) + + client.chat.completions.with_raw_response.create( + messages=[ + { + "content": "string", + "role": "developer", + } + ], + model="gpt-5.4", + verbosity="low", + ) + + calls = cast("list[MockRequestCall]", respx_mock.calls) + data = json.loads(calls[0].request.content.decode("utf-8")) + assert data["verbosity"] == "low" + assert "text" not in data + @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("openai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) From 2b1c65aadb6d0026df415f805d46804f1d4c3f84 Mon Sep 17 00:00:00 2001 From: Junhyuk Lee <58055473+xodn348@users.noreply.github.com> Date: Thu, 30 Apr 2026 11:46:02 -0500 Subject: [PATCH 2/4] Remove nightly runner artifact from PR branch --- NIGHTLY_CODEX_FINAL_ATTEMPT_1.md | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 NIGHTLY_CODEX_FINAL_ATTEMPT_1.md diff --git a/NIGHTLY_CODEX_FINAL_ATTEMPT_1.md b/NIGHTLY_CODEX_FINAL_ATTEMPT_1.md deleted file mode 100644 index cede1090c4..0000000000 --- a/NIGHTLY_CODEX_FINAL_ATTEMPT_1.md +++ /dev/null @@ -1,8 +0,0 @@ -Investigated issue #2610 and stopped without a source/test diff because the checkout already fixes the SDK-side bug: `verbosity` is accepted by `chat.completions.create()` and is serialized as a top-level request body field. - -I added [NIGHTLY_REPORT.md](/home/runner/work/oss-nightly-control/oss-nightly-control/target/NIGHTLY_REPORT.md) with the investigation, verification, failed pytest attempts, and remaining risk. - -Verification run: -`client.chat.completions.create(..., verbosity="low")` produced request JSON containing `"verbosity": "low"`. - -Tests could not run because `pytest` is not installed in the available Python/venv/uv environment. Source: GitHub issue https://github.com/openai/openai-python/issues/2610. \ No newline at end of file From 69dcada2474d295730e9cab0b001ad395754efcb Mon Sep 17 00:00:00 2001 From: Junhyuk Lee <58055473+xodn348@users.noreply.github.com> Date: Thu, 30 Apr 2026 11:46:17 -0500 Subject: [PATCH 3/4] Remove nightly runner artifact from PR branch --- NIGHTLY_CODEX_FINAL_ATTEMPT_2.md | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 NIGHTLY_CODEX_FINAL_ATTEMPT_2.md diff --git a/NIGHTLY_CODEX_FINAL_ATTEMPT_2.md b/NIGHTLY_CODEX_FINAL_ATTEMPT_2.md deleted file mode 100644 index 2b6810c74b..0000000000 --- a/NIGHTLY_CODEX_FINAL_ATTEMPT_2.md +++ /dev/null @@ -1,14 +0,0 @@ -Implemented a small, issue-related test change. - -Changed [tests/test_client.py](/home/runner/work/oss-nightly-control/oss-nightly-control/target/tests/test_client.py:949) to add a focused regression test that calls `chat.completions.with_raw_response.create(..., verbosity="low")` and asserts the request body sends `verbosity` as a top-level `/chat/completions` field, not nested under `text`. - -Updated [NIGHTLY_REPORT.md](/home/runner/work/oss-nightly-control/oss-nightly-control/target/NIGHTLY_REPORT.md:1) with the rationale, verification, and test limitations. - -Verification: -- Passed a direct `uv run python` serialization check showing: - `{"messages": [{"content": "string", "role": "developer"}], "model": "gpt-5.4", "verbosity": "low"}` - -Could not run pytest locally because: -- system Python has no `pytest` -- `uv run python -m pytest ...` has no `pytest` -- `scripts/test ...` requires `rye`, which is not installed here. \ No newline at end of file From 9470d98503751c957f05a25d86855e5f253f2836 Mon Sep 17 00:00:00 2001 From: Junhyuk Lee <58055473+xodn348@users.noreply.github.com> Date: Thu, 30 Apr 2026 11:46:18 -0500 Subject: [PATCH 4/4] Remove nightly retry artifact from PR branch --- .codex-nightly-retry-1.md | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 .codex-nightly-retry-1.md diff --git a/.codex-nightly-retry-1.md b/.codex-nightly-retry-1.md deleted file mode 100644 index 95d75f4e57..0000000000 --- a/.codex-nightly-retry-1.md +++ /dev/null @@ -1,13 +0,0 @@ -The previous attempt produced no source, test, docs, or example changes. - -Continue working. A successful nightly slot must produce a small, honest, -maintainer-reviewable PR unless the repository is technically impossible -to patch for this target. - -Requirements for this retry: -- Search the local repository for a directly related patch surface. -- Prefer a focused test, docs/example correction, typing/schema fix, CLI behavior fix, or small error-handling improvement. -- If the exact upstream symptom is server-side, produce a repository-local improvement that prevents user confusion or locks existing behavior without falsely claiming to fix the server. -- Do not stop with only NIGHTLY_REPORT.md. -- Modify at least one tracked source, test, docs, or example file if a defensible PR exists. -- Keep the diff small and explain the rationale in NIGHTLY_REPORT.md.