mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
Record local image inputs on completed image-generation items (#54420)
## What changed Add optional `inputImages` metadata containing each referenced local image's path and SHA-256 hash of the bytes read before normalization. Compute the hash from the same bytes used to prepare the edit request. Preserve this metadata through completion events, persisted thread history, resume, and legacy rollout migration. Update app-server schemas and generated TypeScript and Python types; older items continue to deserialize without the field. ## Testing Add coverage for input ordering, changed contents at the same path, unreadable or invalid references, serialization, persisted history and resume, and legacy migration. GitOrigin-RevId: 522be8ec1e39c9b2bbe5b9ccb37ea67d17f0e21a
This commit is contained in:
@@ -470,6 +470,7 @@ impl ImageGenerationItem {
|
||||
transparent_background: None,
|
||||
failure: None,
|
||||
saved_path: self.saved_path.clone(),
|
||||
input_images: Vec::new(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ use crate::turn_input::TurnInputSubmission;
|
||||
use crate::turn_input::TurnStartOptions;
|
||||
use codex_extension_items::image_generation::GeneratedImageRef;
|
||||
use codex_extension_items::image_generation::ImageGenerationFailure;
|
||||
use codex_extension_items::image_generation::ImageGenerationInputImage;
|
||||
use codex_utils_absolute_path::AbsolutePathBuf;
|
||||
use codex_utils_path_uri::PathUri;
|
||||
use schemars::JsonSchema;
|
||||
@@ -2936,6 +2937,9 @@ pub struct ImageGenerationEndEvent {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub saved_path: Option<AbsolutePathBuf>,
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
#[ts(as = "Option<_>", optional)]
|
||||
pub input_images: Vec<ImageGenerationInputImage>,
|
||||
}
|
||||
|
||||
// Conversation kept for backward compatibility.
|
||||
|
||||
Reference in New Issue
Block a user