Skip to content

test(openai realtime): fix process_base_url assertion that was always passing#5903

Merged
u9g merged 1 commit into
mainfrom
fix/test-process-base-url-trailing-comma
May 30, 2026
Merged

test(openai realtime): fix process_base_url assertion that was always passing#5903
u9g merged 1 commit into
mainfrom
fix/test-process-base-url-trailing-comma

Conversation

@u9g
Copy link
Copy Markdown
Contributor

@u9g u9g commented May 30, 2026

Summary

One assertion in test_process_base_url had a trailing comma on the RHS, turning the asserted expression into a 1-tuple (always truthy). The # noqa: F631 silenced ruff's warning about it. The assertion has been silently inert and would have masked any regression in process_base_url's handling of already-formed wss:// URLs.

History

  • b156eaa6a (2025-03-17) — introduced the test, originally asserting that &model=gpt-4 IS appended:
    == "wss://livekit.ai/voice/v1/chat/voice?client=oai&enable_noise_suppression=true&model=gpt-4"
    
  • f0df13cf0 (2025-03-17, 3 min later, commit msg "fix test") — in one move dropped &model=gpt-4 from 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_url
  • uv run ruff check tests/test_config.py

… 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.
@chenghao-mou chenghao-mou requested a review from a team May 30, 2026 18:07
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@u9g u9g merged commit 49f8d96 into main May 30, 2026
27 checks passed
@u9g u9g deleted the fix/test-process-base-url-trailing-comma branch May 30, 2026 18:53
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.

3 participants