Skip startup prewarm when websockets are disabled#25868
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9876ae24f1
ℹ️ 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".
| if !self.services.model_client.responses_websocket_enabled() { | ||
| return; |
There was a problem hiding this comment.
Preserve regular turns when prewarm is skipped
When responses_websocket_enabled() is false (for HTTP-only providers or after websocket fallback is disabled), this early return leaves startup_prewarm unset. The first regular turn then calls consume_startup_prewarm_for_regular_turn(), receives Unavailable { status: "not_scheduled" }, and RegularTask::run returns None instead of creating a normal HTTP ModelClientSession, so the turn stops after TurnStarted without sending the model request. Either keep scheduling a no-op ready session for this path or make the regular-turn path continue without a prewarmed session when prewarm was intentionally skipped.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I think this is already handled: Unavailable does not return from RegularTask::run; only Cancelled does. The Unavailable case maps to None, then run_turn() is still called, and run_turn() creates a fresh normal client session via unwrap_or_else(|| sess.services.model_client.new_session()).
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9876ae24f1
ℹ️ 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".
Summary
Why
Recent macOS timing flakes were timing out while waiting for first-turn events in HTTP-only core tests. Startup prewarm is only useful for websocket-capable providers, but it was scheduled for every session. For HTTP-only test providers this added unnecessary async startup work before the regular turn could reach the mocked response flow.
Testing