test(openai realtime): fix process_base_url assertion that was always passing#5903
Merged
Conversation
… passing The third assert in test_process_base_url had a trailing comma on the RHS, making it a 1-tuple (always truthy); the # noqa: F631 silenced ruff's warning about it. Removing both surfaces what the assertion was meant to check. The expected string is restored to include &model=gpt-4, matching the test as originally written in b156eaa and the function's actual behavior. The intermediate "fix test" commit (f0df13c) dropped &model=gpt-4 from the expected and introduced the trailing comma in the same change, with no commit message rationale; the assertion has been silently inert ever since. The OpenAI/Azure Realtime docs do not specify a "proxy URLs skip model=" contract, so the original append-model behavior is preserved.
davidzhao
approved these changes
May 30, 2026
theomonnom
approved these changes
May 30, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
One assertion in
test_process_base_urlhad a trailing comma on the RHS, turning the asserted expression into a 1-tuple (always truthy). The# noqa: F631silenced ruff's warning about it. The assertion has been silently inert and would have masked any regression inprocess_base_url's handling of already-formedwss://URLs.History
&model=gpt-4IS appended:&model=gpt-4from the expected string AND added the trailing comma that makes the assert always pass. No PR discussion exists.This change
Restores the originally-asserted expected value (with
&model=gpt-4) and removes the trailing comma +# noqa: F631. The assertion now actually verifies the function's current behavior. OpenAI and Azure Realtime docs do not specify a "proxy URLs should skip?model=" contract, so there's no documented reason to expect passthrough behavior — preserving append-model is the conservative choice.No implementation changes; no behavior change in production.
Test plan
uv run pytest tests/test_config.py -k test_process_base_urluv run ruff check tests/test_config.py