Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions codex-rs/core/src/session_startup_prewarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ impl SessionStartupPrewarmHandle {

impl Session {
pub(crate) async fn schedule_startup_prewarm(self: &Arc<Self>, base_instructions: String) {
if !self.services.model_client.responses_websocket_enabled() {
return;
Comment on lines +175 to +176

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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()).

Comment thread
jif-oai marked this conversation as resolved.
}

let session_telemetry = self.services.session_telemetry.clone();
let websocket_connect_timeout = self.provider().await.websocket_connect_timeout();
let started_at = Instant::now();
Expand Down
Loading