[codex] Preserve steer input as user input#23405
Conversation
9aee7c7 to
44ebf79
Compare
|
@codex review this |
…r-messages # Conflicts: # codex-rs/core/src/session/turn.rs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 44ebf79791
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| .push_pending_input_and_accept_mailbox_delivery_for_turn_state( | ||
| active_turn.turn_state.as_ref(), | ||
| input.into(), | ||
| TurnInput::UserInput(input), |
There was a problem hiding this comment.
Materialize steered local images before queuing
When a steered prompt contains UserInput::LocalImage, this now queues the raw path until the pending input is eventually accepted, and ResponseInputItem::from(...) reads the file later in record_user_prompt_and_emit_turn_item. If the current model turn runs for a while and the local image is edited or deleted before the steer is drained, the model receives the changed file or an error placeholder rather than the image the user submitted; the previous input.into() materialized the image bytes at steer time.
Useful? React with 👍 / 👎.
…r-messages # Conflicts: # codex-rs/core/src/session/turn.rs
…r-messages # Conflicts: # codex-rs/core/src/hook_runtime.rs # codex-rs/core/src/session/turn.rs
Why
Steered input was queued as a
ResponseInputItem, then parsed back into a user message before recording. That path loses information that only exists onUserInput, such as UI text elements.This change keeps turn-local pending input typed as either original
UserInputor existing response items, so steered user input reaches user-message recording without being reconstructed from a response item.What changed
TurnInputfor active-turn pending input.Session::steer_inputasTurnInput::UserInput.TurnInput::UserInput.Validation
just fmtjust fix -p codex-coreRUST_MIN_STACK=16777216 cargo test -p codex-core --lib session::tests::task_finish_emits_turn_item_lifecycle_for_leftover_pending_user_input -- --nocaptureRUST_MIN_STACK=16777216 cargo test -p codex-core --lib steer_inputRUST_MIN_STACK=16777216 cargo test -p codex-core --lib pending_inputRUST_MIN_STACK=16777216 cargo test -p codex-core --test all pending_inputRUST_MIN_STACK=16777216 cargo test -p codex-core(unit tests passed: 1835 passed, 0 failed, 4 ignored; integrationalltarget failed due missing helper binaries such ascodex/test_stdio_serverplus unrelated MCP/search/code-mode expectations)