fix(api): prioritize Python request routing fields - #4014
Conversation
Castiron-Internal-PR: openai/openai-python-internal#160 Castiron-Source-SHA: 656e88c51bc2bd41723d286f7330123ea3501834 Castiron-Public-Base-SHA: 93bd2aa
Castiron custom codeEvaluated main: ✅ No new custom-code files detected. 49 mixed files remain; 0 existing customizations changed; 2 customizations removed; 7 generated baselines changed. Compared
42 existing customizations unchanged
2 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 36963754998 --repo openai/openai-python \
--name castiron-custom-code-36963754998-1 --dir /tmp/castiron-custom-code-36963754998-1
git apply --stat /tmp/castiron-custom-code-36963754998-1/custom-code.patch
cat /tmp/castiron-custom-code-36963754998-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 93bd2aa0fe0bb6658d510551f2670b231749385f f61782398f3eb73d8f77101ad418de4edcabc088
python3 scripts/castiron/custom_code_report.py report \
--base 93bd2aa0fe0bb6658d510551f2670b231749385f \
--head f61782398f3eb73d8f77101ad418de4edcabc088 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-f61782398f3e
cat /tmp/castiron-custom-code-f61782398f3e/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
dpiet-oai
left a comment
There was a problem hiding this comment.
Reviewed all 19 changed files at f617823 and the surrounding sync/async transformation, omission, extra-body merge, and serialization paths. No actionable findings. The request-body changes preserve existing values and non-routing field order while placing routing fields first. The remaining changes cover generation metadata, the error-description shortening, and optional-metadata test cleanup.
Static review only; I did not run tests or independently reproduce the reported transport assertions.
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. |
markstuart-oai
left a comment
There was a problem hiding this comment.
Reviewed all 19 changed files at f617823. No actionable findings. The 40 request-dictionary reorderings preserve values, omitted-field behavior and the relative order of other fields; the existing sync/async transform and JSON serialization paths preserve the new routing-field order. Public signatures and multipart/form handling are unchanged. The optional-metadata test cleanup retains explicit-empty coverage.
Source-only review; I did not run local tests or repeat the reported transport assertions. Hosted build, lint, Python 3.10/3.14, HTTPX2 and Castiron budget checks passed on this head. A newer baseline-consistency run was still in progress when checked.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f61782398f
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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
Prioritizes
model,stream, andservice_tierin Python JSON request bodies, placing them before potentially largeinputormessagesfields.Changes
application/jsonrequest body.SessionTurnErrorerror-category description.