Skip to content

fix: preserve single files for fallback extraction paths - #3875

Merged
marcuswood-oai merged 3 commits into
openai:mainfrom
HaokaiDing:fix/skills-single-file-upload
Sep 23, 2026
Merged

marcuswood-oai merged 3 commits into
openai:mainfrom
HaokaiDing:fix/skills-single-file-upload

Conversation

@HaokaiDing

Copy link
Copy Markdown
Contributor
  • I understand that this repository is auto-generated and my pull request may not be merged.

Changes being requested

Fixes #3874.

When the Skills files parameter is a single file, the array extraction path consumes it before the fallback single-file path can run. This produces an empty JSON request instead of uploading the file.

Keep non-list values available when a path still expects an array. Direct file extraction and list uploads retain their existing behavior. Add bytes/tuple extraction regressions and synchronous/asynchronous public-client tests that construct a real in-memory zip and inspect its multipart field, filename and content through MockTransport.

Additional context & links

  • Skills create accepts a single zip or multiple files.
  • Before the fix: 4 failed, 33 passed. After: 37 passed with PYTHONPATH=src .venv/bin/python -m pytest -o addopts='' tests/test_extract_files.py tests/test_files.py -q. Tests run serially and make no live API requests.
  • Ruff lint and format checks pass on all three changed files; git diff --check passes.
  • Python 3.13.15, httpx2 2.12.0, Pydantic 2.13.5 on macOS ARM64. The full SDK suite, Pyright and mypy were not run locally.
  • The custom-code policy, budget and generated ownership metadata are unchanged. Budget validation remains with the trusted upstream CI; SDK CODEOWNER review is required for this file-handling change.

@HaokaiDing
HaokaiDing requested a review from a team as a code owner September 16, 2026 12:38
Copilot AI lite review requested due to automatic review settings September 16, 2026 12:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-16T12:41:57.562599Z 2ac713c PR opened
🔒 Security Review ✅ Completed 2026-09-16T12:41:49.527871Z 2ac713c PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Contributor

Thanks for catching this and putting together the fix! We’ve merged main into your branch and simplified the tests. Single-file and list uploads are working in both clients, and our checks are passing—happy to get this in!

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

47 mixed files remain; 0 existing customizations changed.

Compared 4d1274681db7 → 9887eede6629. Generated baselines verified.

47 existing customizations unchanged
  • api.md
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • src/openai/init.py
  • src/openai/_client.py
  • src/openai/resources/audio/transcriptions.py
  • src/openai/resources/audio/translations.py
  • src/openai/resources/beta/agents/sessions/sessions.py
  • src/openai/resources/beta/beta.py
  • src/openai/resources/beta/responses/responses.py
  • src/openai/resources/beta/threads/runs/runs.py
  • src/openai/resources/beta/threads/threads.py
  • src/openai/resources/chat/completions/completions.py
  • src/openai/resources/embeddings.py
  • src/openai/resources/files.py
  • src/openai/resources/live/forks.py
  • src/openai/resources/live/live.py
  • src/openai/resources/live/sideband.py
  • src/openai/resources/realtime/api.md
  • src/openai/resources/realtime/realtime.py
  • src/openai/resources/responses/responses.py
  • src/openai/resources/uploads/uploads.py
  • src/openai/resources/vector_stores/file_batches.py
  • src/openai/resources/vector_stores/files.py
  • src/openai/resources/videos.py
  • src/openai/resources/webhooks/init.py
  • src/openai/resources/webhooks/webhooks.py
  • src/openai/types/beta/agent_session_message.py
  • src/openai/types/chat/init.py
  • src/openai/types/chat/chat_completion_message_tool_call.py
  • src/openai/types/fine_tuning/fine_tuning_job_integration.py
  • src/openai/types/realtime/conversation_item_input_audio_transcription_delta_event.py
  • src/openai/types/realtime/realtime_error_event.py
  • src/openai/types/responses/init.py
  • src/openai/types/responses/response.py
  • src/openai/types/responses/response_function_web_search.py
  • src/openai/types/responses/response_function_web_search_param.py
  • src/openai/types/responses/responses_client_event.py
  • src/openai/types/responses/responses_client_event_param.py

7 more in the full report.

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 35922262769 --repo openai/openai-python \
  --name castiron-custom-code-35922262769-1 --dir /tmp/castiron-custom-code-35922262769-1
git apply --stat /tmp/castiron-custom-code-35922262769-1/custom-code.patch
cat /tmp/castiron-custom-code-35922262769-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin 4d1274681db7f34f671ff9e71adc1461d22a927b 9887eede6629afb385e7c8dd66fb5eb155520c73
python3 scripts/castiron/custom_code_report.py report \
  --base 4d1274681db7f34f671ff9e71adc1461d22a927b \
  --head 9887eede6629afb385e7c8dd66fb5eb155520c73 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-9887eede6629
cat /tmp/castiron-custom-code-9887eede6629/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

@marcuswood-oai
marcuswood-oai added this pull request to the merge queue Sep 23, 2026
Merged via the queue into openai:main with commit bfd3680 Sep 23, 2026
16 checks passed
@openai-sdks openai-sdks Bot mentioned this pull request Sep 23, 2026
pull Bot pushed a commit to specialized806/openai-python that referenced this pull request Sep 24, 2026
Automated Release PR
---


##
[3.19.2](openai/openai-python@v3.19.1...v3.19.2)
(2026-09-23)


### Bug Fixes

* preserve single files for fallback extraction paths
([openai#3875](openai#3875))
([bfd3680](openai@bfd3680))


### Chores

* **api:** clarify approximate web search location defaults
([openai#3953](openai#3953))
([a95c95e](openai@a95c95e))
* **api:** clarify Realtime modality array definitions
([openai#3954](openai#3954))
([e79cf53](openai@e79cf53))
* **api:** correct fine-tuning bounds and Realtime response reference
([openai#3949](openai#3949))
([325a948](openai@325a948))

---
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>
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.

Skills single-file ZIP uploads are dropped during file extraction

3 participants