Repository navigation
Public URLSession configuration seam on API - #44
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8d454977b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
odrobnik
left a comment
There was a problem hiding this comment.
Follow-up review of f766808. The session pair is now guarded by a lock, so use(...) is safe while requests are starting. The configuration: / streamConfiguration: parameters are passed through the OpenAI, ChatGPTCodex, Anthropic, GoogleAPI and LMStudio initialisers. OllamaAPI inherits the base init, so it gets the seam without changes. Defaults are unchanged: with neither argument given, the 360 s / 600 s sessions are built as before. When only configuration is given, the stream session derives from a copy of it with 600 s timeouts, so one stub covers both. Anthropic streaming now goes through streamSession, so the seam covers it. The new tests import Providers without @testable and stub generateImages and createResponseStream, which meets the acceptance criteria. I did not build or run anything; all six CI jobs are green. I found no remaining issues. The URLSession.shared calls the description lists as out of scope are a known limit.
👍 No findings.
Reviewed by Claude
Resolves #43.
Added
configuration:/streamConfiguration:(bothURLSessionConfiguration? = nil) toAPI.initand the OpenAI, ChatGPTCodex, Anthropic, GoogleAPI and LMStudio initialisers, plus a publicuse(sessionConfiguration:streamConfiguration:). With neither argument given, the 360 s / 600 s defaults are unchanged. If onlyconfigurationis given, the stream session derives from a copy of it with 600 s timeouts, so one stub covers both sessions. Anthropic streaming now usesstreamSessioninstead of a private session. NewPublicSessionSeamTestsuses plainimport Providersto stubgenerateImagesandcreateResponseStream.ChatGPTCodexLiveTestsno longer needs@testable. Build, the relevant tests andswiftlint --strictpass locally on macOS only; Linux, Windows and Android are unchecked. Not changed: the manyURLSession.sharedcalls in the Assistants, Conversations and Traces extensions, and the Google embeddings call, still bypass the seam; moving them tosessionwould change their timeouts.OpenAIResponsesWebSocketalso keeps its own session.