fix(api): prioritize routing fields in parse helpers - #4016
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Castiron custom codeEvaluated main: ✅ No new custom-code files detected. 49 mixed files remain; 2 existing customizations changed. Compared
47 existing customizations unchanged
7 more in the full report. A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 36965280849 --repo openai/openai-python \
--name castiron-custom-code-36965280849-1 --dir /tmp/castiron-custom-code-36965280849-1
git apply --stat /tmp/castiron-custom-code-36965280849-1/custom-code.patch
cat /tmp/castiron-custom-code-36965280849-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin ffcc4c47279debd9daff6103da57dcde2efd38bd 37bd842f06a40f0f2df63513d1de31f6bd12effa
python3 scripts/castiron/custom_code_report.py report \
--base ffcc4c47279debd9daff6103da57dcde2efd38bd \
--head 37bd842f06a40f0f2df63513d1de31f6bd12effa --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-37bd842f06a4
cat /tmp/castiron-custom-code-37bd842f06a4/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
markstuart-oai
left a comment
There was a problem hiding this comment.
Reviewed all three changed files at 37bd842. No actionable findings. The four parse request dictionaries now prioritize model, stream and service_tier while preserving values, signatures, omission behavior and the relative order of other fields. The existing transform and JSON serialization paths preserve that order through the HTTP body. The new sync/async tests check the actual wire bytes for both explicit and omitted routing fields.
Source-only review; I did not execute repository tests locally. Hosted lint, build, Python 3.10/3.14, HTTPX2, baseline-consistency and custom-code budget checks passed on this head.
Automated Release PR --- ## [3.24.0](openai/openai-python@v3.23.0...v3.24.0) (2026-10-02) ### Features * **api:** add custom voice creation and agent session events ([openai#4013](openai#4013)) ([e5de2e5](openai@e5de2e5)) ### Bug Fixes * **api:** prioritize Python request routing fields ([openai#4014](openai#4014)) ([ffcc4c4](openai@ffcc4c4)) * **api:** prioritize routing fields in parse helpers ([openai#4016](openai#4016)) ([ba53a10](openai@ba53a10)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
Summary
Ensure structured-output request helpers place
model,stream, andservice_tierbefore potentially largeinputormessagesfields.Changes
Responses.parserequests.chat.completions.parserequests.Test plan
uv run --frozen --all-extras pytest tests/test_request_body_routing_order.py -quv run --frozen --all-extras ruff check src/openai/resources/responses/responses.py src/openai/resources/chat/completions/completions.py tests/test_request_body_routing_order.pyuv run --frozen --all-extras ruff format --check src/openai/resources/responses/responses.py src/openai/resources/chat/completions/completions.py tests/test_request_body_routing_order.pygit diff --check