Migrate tui to use UserTurn (#9497)

- `tui/` and `tui2/` submit `Op::UserTurn` and own full turn context
(cwd/approval/sandbox/model/etc.).
- `Op::UserInput` is documented as legacy in `codex-protocol` (doc-only;
no `#[deprecated]` to avoid `-D warnings` fallout).
- Remove obsolete `#[allow(deprecated)]` and the unused `ConversationId`
alias/re-export.
This commit is contained in:
Ahmed Ibrahim
2026-01-19 13:40:39 -08:00
committed by GitHub
parent 0c0c5aeddc
commit 65d3b9e145
8 changed files with 61 additions and 69 deletions

View File

@@ -1,7 +1,5 @@
pub mod account;
mod thread_id;
#[allow(deprecated)]
pub use thread_id::ConversationId;
pub use thread_id::ThreadId;
pub mod approvals;
pub mod config_types;

View File

@@ -83,7 +83,10 @@ pub enum Op {
/// This server sends [`EventMsg::TurnAborted`] in response.
Interrupt,
/// Input from the user
/// Legacy user input.
///
/// Prefer [`Op::UserTurn`] so the caller provides full turn context
/// (cwd/approval/sandbox/model/etc.) for each turn.
UserInput {
/// User input items, see `InputItem`
items: Vec<UserInput>,
@@ -131,7 +134,8 @@ pub enum Op {
///
/// All fields are optional; when omitted, the existing value is preserved.
/// This does not enqueue any input it only updates defaults used for
/// future `UserInput` turns.
/// turns that rely on persistent session-level context (for example,
/// [`Op::UserInput`]).
OverrideTurnContext {
/// Updated `cwd` for sandbox/tool calls.
#[serde(skip_serializing_if = "Option::is_none")]

View File

@@ -70,10 +70,6 @@ impl JsonSchema for ThreadId {
}
}
/// Backward-compatible alias for the previous name.
#[deprecated(note = "use ThreadId instead")]
pub type ConversationId = ThreadId;
#[cfg(test)]
mod tests {
use super::*;