Skip to content

[codex] Allow empty turn/start requests#23409

Merged
pakrym-oai merged 2 commits into
mainfrom
pakrym/empty-turn-start
May 19, 2026
Merged

[codex] Allow empty turn/start requests#23409
pakrym-oai merged 2 commits into
mainfrom
pakrym/empty-turn-start

Conversation

@pakrym-oai
Copy link
Copy Markdown
Collaborator

@pakrym-oai pakrym-oai commented May 19, 2026

Why

turn/start already accepts an input array on the wire, including an empty array, but core treated empty input as a no-op before the turn could reach the model. App-server clients need to be able to start a real turn even when there is no new user message, for example to let the model proceed from existing thread context.

What changed

  • Removed the run_turn early return that skipped empty-input turns when there was no pending input.
  • Kept empty active-turn steering rejected by moving the steer_input empty-input check until after core has determined whether there is an active regular turn.
  • Empty regular turns now refresh previous_turn_settings like other regular turns, so follow-up context injection state advances consistently.
  • Added an app-server v2 integration test proving turn/start with input: [] emits started/completed notifications, sends one Responses request, and does not synthesize an empty user message.

Validation

  • cargo test -p codex-app-server --test all turn_start_with_empty_input_runs_model_request

@pakrym-oai pakrym-oai marked this pull request as ready for review May 19, 2026 03:54
@pakrym-oai pakrym-oai requested a review from a team as a code owner May 19, 2026 03:54
@pakrym-oai pakrym-oai force-pushed the pakrym/empty-turn-start branch from 613d208 to 87ecaa2 Compare May 19, 2026 03:57
@pakrym-oai pakrym-oai marked this pull request as draft May 19, 2026 03:57
@pakrym-oai pakrym-oai force-pushed the pakrym/empty-turn-start branch from 87ecaa2 to 2c0815f Compare May 19, 2026 04:32
@pakrym-oai pakrym-oai marked this pull request as ready for review May 19, 2026 04:41
Comment thread codex-rs/core/src/session/turn.rs Outdated
}

if input.is_empty() {
return Err(SteerInputError::EmptyInput);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This changes the client side contract. Can you make sure it does not impact the clients, analytics and flywheel?

@pakrym-oai pakrym-oai force-pushed the pakrym/empty-turn-start branch from 2c0815f to 0b7b780 Compare May 19, 2026 15:08
# Conflicts:
#	codex-rs/core/src/session/turn.rs
@pakrym-oai pakrym-oai merged commit ef24ef1 into main May 19, 2026
31 checks passed
@pakrym-oai pakrym-oai deleted the pakrym/empty-turn-start branch May 19, 2026 15:39
@github-actions github-actions Bot locked and limited conversation to collaborators May 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants