mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
Preserve host-assigned user input IDs in Responses messages (#57538)
## What changed Add optional `TurnInputRequest.user_item_uuid` and carry it through turn starts and steering to the recorded user message. When supplied, use `msg_input_<uuid>` as the Responses item ID; inputs without a UUID retain generated IDs. Raw response items ignore this field. Add `ResponseItemId` helpers to construct and recognize the reserved `msg_input_` namespace. ## Testing Add regression coverage for steered inputs with identical text and client IDs, checking that each supplied UUID survives recording and UI item IDs remain distinct. Add a scenario test verifying that the assigned ID reaches Responses and persists in subsequent request history alongside an identical ordinary prompt. GitOrigin-RevId: 440e306bfdaa7facb69b21930c5244a83db2fdae
This commit is contained in:
@@ -24,6 +24,9 @@ use tokio_util::task::AbortOnDropHandle;
|
||||
pub struct UserInputMetadata {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub acceptance_order: Option<u64>,
|
||||
/// Optional host-assigned UUID for this particular Responses user item.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub response_item_uuid: Option<uuid::Uuid>,
|
||||
#[serde(
|
||||
default,
|
||||
skip_serializing_if = "codex_history::UserInputOrigin::is_user"
|
||||
|
||||
Reference in New Issue
Block a user