Extract user input preparation into codex-user-input (#61949)

## What changed

Move local attachment snapshotting and conversion from `UserInput` to model request content out of `codex-protocol` into a dedicated `codex-user-input` crate. Update core, the TUI, and the queue extension to use the new crate, replacing the `ResponseInputItem` conversion methods with `from_user_input`.

Move the associated attachment and message conversion tests alongside the implementation, preserving coverage for image positions, media labels, serialization, and error placeholders.

GitOrigin-RevId: 77d0f94a4cd4c2edc008b9e2e63a989995aab058
This commit is contained in:
Adam Perry @ OpenAI
2026-11-17 02:43:52 +00:00
committed by copyberry
parent ad161203cb
commit 5b3d2c7fce
24 changed files with 814 additions and 723 deletions
+2 -3
View File
@@ -33,8 +33,7 @@ pub enum UserInput {
#[ts(optional)]
detail: Option<ImageDetail>,
},
/// Local image path provided by the user. This will be converted to an
/// `Image` variant (base64 data URL) during request serialization.
/// Local image attachment provided by path.
LocalImage {
path: std::path::PathBuf,
#[serde(default, skip_serializing_if = "Option::is_none")]
@@ -46,7 +45,7 @@ pub enum UserInput {
#[serde(flatten)]
audio: AudioReference,
},
/// Local audio path converted to an `Audio` data URI during request serialization.
/// Local audio attachment provided by path.
LocalAudio { path: std::path::PathBuf },
/// Skill selected by the user (name + path to SKILL.md).