[pull] main from openai:main - #195
Merged
Merged
Conversation
Fields wrapped in `NotRequired` currently skip alias, format, and nested transformation metadata. Unwrap it alongside `Required` so optional typed-dictionary fields serialize consistently, while omitted fields stay omitted. Carries forward @Shubham-Padkonde’s fix from #3872 with current main merged in, preserving the original commit and authorship. Includes one focused sync/async regression covering aliases, date formatting, nested dictionaries, lists, and omission. Validation: both regression cases fail on main; 69 transform/typing tests pass on each Pydantic version. Ruff, mypy, strict Pyright, and the custom-code budget pass. Security review found no new dependencies, execution paths, network destinations, or credential handling. Co-authored-by: Shubham Padkonde <shubhampadkonde12@gmail.com>
Automated Release PR --- ## [3.22.1](v3.22.0...v3.22.1) (2026-09-30) ### Bug Fixes * **api:** correct the missing authentication error message ([#3993](#3993)) ([51692ed](51692ed)), closes [#3962](#3962) * transform NotRequired typed dictionary fields ([#3995](#3995)) ([5544c18](5544c18)) ### Chores * **tests:** mark sample_file.txt as text with LF line endings ([#3879](#3879)) ([fd78a48](fd78a48)) ### Documentation * **examples:** fix two stale example comments ([#3877](#3877)) ([1c4830b](1c4830b)) * **examples:** print event.delta in the streaming helpers doc ([#3876](#3876)) ([063375b](063375b)) --- 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 - Use `time.monotonic()` for elapsed-time deadlines in both synchronous and asynchronous file-processing polling. - Add regression coverage for a wall-clock rollback in both resource variants. ## Bug `Files.wait_for_processing()` and its asynchronous counterpart used `time.time()` to measure elapsed time. If the system wall clock moves backwards while a file is still processing, the calculated elapsed time also moves backwards and the timeout can be postponed indefinitely. ### Reproduction With `max_wait_seconds=1`, `poll_interval=5`, and a wall clock that changes from `100` to `90` after the first poll: - Expected: raise the timeout error once the monotonic deadline has elapsed. - Actual before this change: continue polling and enter another five-second sleep. ## Root cause Wall-clock time is adjustable and is not suitable for measuring elapsed durations. ## Fix Use Python's monotonic clock for both the initial timestamp and every deadline check. This does not change the public API, poll interval, terminal states, or error message. ## Validation - `tests/lib/test_file_processing.py`: 15 passed - Ruff check: passed - Ruff format check: passed - Isolated synchronous and asynchronous rollback reproducer: passed Commands used: ```text PYTHONPATH=/tmp/openai-python-file-timeout-deps-20260828:src python -m pytest -p no:cacheprovider -o addopts= --confcutdir=tests/lib --asyncio-mode=auto -q tests/lib/test_file_processing.py python -m ruff check --no-cache src/openai/lib/_files.py tests/lib/test_file_processing.py python -m ruff format --no-cache --check src/openai/lib/_files.py tests/lib/test_file_processing.py ``` --------- Co-authored-by: Marcus Wood <marcuswood@openai.com>
## Summary Responses WebSocket connections now honor `max_queue_size` during reconnect even when no messages were queued before connecting. ## Changes - Keep the caller's configured send queue for synchronous and asynchronous Responses connections, including beta Responses. - Continue raising `WebSocketQueueFullError` at the configured byte limit and flush admitted messages after reconnect. Co-authored-by: markstuart-oai <323302876+markstuart-oai@users.noreply.github.com>
## Summary Preserve WebSocket endpoint paths and query parameters when using a custom base URL. ## Changes - Keep the Responses endpoint when the base URL includes a query string. - Preserve query parameters on an explicit WebSocket base URL for Responses, Realtime, and Live. - Let connection query parameters override the selected URL, and the selected URL override client defaults. Preserve repeated URL query values. Co-authored-by: markstuart-oai <323302876+markstuart-oai@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )