Repository navigation
FIX: RealtimeTarget converts mixed-case HTTPS:// endpoints to wss:// - #4804
Queued
Akshay Hitesh Shah (AkshayShah03) wants to merge 3 commits into
Queued
Akshay Hitesh Shah (AkshayShah03) wants to merge 3 commits into
Akshay Hitesh Shah (AkshayShah03) wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the mixed-case HTTPS/WSS scheme handling changes.
No open issues 🎉
What changed in this PR
Fixes #4785 by making RealtimeTarget accept mixed-case HTTPS and WSS schemes, consistent with earlier HTTP scheme fixes.
Changes:
- Normalizes supported schemes to
wss://for validation and client creation. - Makes irregular-endpoint checks case-insensitive.
- Adds regression tests for URL conversion and warning behavior.
| File | Description |
|---|---|
tests/unit/prompt_target/target/test_realtime_target.py |
Tests mixed-case schemes and absence of spurious warnings. |
pyrit/prompt_target/openai/openai_realtime_target.py |
Adds scheme-normalization helpers and updates endpoint checks and client creation. |
Review effort: Balanced
Roman Lutz (romanlutz)
approved these changes
Dec 3, 2026
Roman Lutz (romanlutz)
enabled auto-merge
December 3, 2026 06:34
This branch has not been deployed
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.
Description
Fixes #4785.
RealtimeTargetnow treats the endpoint scheme case-insensitively (RFC 3986 §3.1), soHTTPS://...becomeswss://...likehttps://...already did. This is the same kind of fix #4601 / #4603 made for the MCP config andHTTPTarget._url_schemeand_to_websocket_urlinopenai_realtime_target.py._to_websocket_urlrewrites anhttpsorwssscheme in any case towss://and leaves other schemes alone._get_openai_clientand_validate_url_for_targetuse_to_websocket_url, so the websocket URL is valid and the "should use 'wss://' or 'https://' scheme" warning no longer fires forHTTPS://._warn_if_irregular_realtime_endpointchecks the scheme with_url_schemeand matches its patterns withre.IGNORECASE. Nothing calls it right now; I changed it so it stays consistent if it gets called again.HTTPS://,Https://andWSS://endpoints all produce awss://websocket_base_urlwith no scheme warning, and the irregular-endpoint check doesn't warn on an uppercase scheme. 5 of the 6 cases fail on main; the lowercasehttps://case is a control.Disclosure: this change and its tests were written with the help of an AI coding assistant (Claude). The prompt_target unit suite passes locally.