Skip to content

fix: reject non-default OpenAI base URL ports#3434

Closed
pragnyanramtha wants to merge 1 commit into
openai:mainfrom
pragnyanramtha:pragnyan/fix-official-openai-port-detection
Closed

fix: reject non-default OpenAI base URL ports#3434
pragnyanramtha wants to merge 1 commit into
openai:mainfrom
pragnyanramtha:pragnyan/fix-official-openai-port-detection

Conversation

@pragnyanramtha
Copy link
Copy Markdown

Summary

  • require official OpenAI base URLs to use no explicit port or the default TLS port 443
  • fail closed for malformed or out-of-range ports instead of raising from urlsplit(...).port
  • add HTTPS and WSS regression coverage for :443, non-default :444, out-of-range :99999, and non-numeric :abc

Validation

  • uv run pytest tests/models/test_openai_client_utils.py -q -> 12 passed
  • uv run mypy src/agents/models/openai_client_utils.py tests/models/test_openai_client_utils.py -> passed
  • uv run pyright src/agents/models/openai_client_utils.py tests/models/test_openai_client_utils.py -> passed
  • make format -> passed during worker validation
  • make lint -> passed during worker validation
  • git diff --check -> passed

Full code-change-verification was attempted during worker validation, but the repository-wide typecheck/tests did not finish in this local environment after roughly 55 minutes. The focused helper tests and type checks above passed.

@pragnyanramtha pragnyanramtha marked this pull request as ready for review May 16, 2026 16:30
Copilot AI review requested due to automatic review settings May 16, 2026 16:30
@seratch seratch added the wontfix This will not be worked on label May 17, 2026
@seratch seratch closed this May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants