mirror of
https://github.com/openai/codex.git
synced 2026-11-21 22:50:37 +00:00
Preserve per-image metadata in app-server image generation items (#62871)
## Why App-server clients lose metadata supplied by the image backend when Codex turns the response into a completed image generation item. ## What changed Expose the backend's `image_metadata` as optional `imageMetadata` in app-server items and preserve nested values through thread persistence, resume, and legacy history replay and migration. Keep this metadata out of model tool output. Omit empty metadata and discard non-object, oversized, or deeply nested metadata without dropping the generated image. ## Testing Extend coverage for per-image parsing, metadata limits, and round trips through app-server completion, persisted history, and thread resume. GitOrigin-RevId: 7211a9db1149cb05e6176b08b0462ca173ac72d5
This commit is contained in:
committed by
copyberry
parent
e346540867
commit
0bfb8467da
@@ -622,6 +622,7 @@ mod tests {
|
||||
input_images: Vec::new(),
|
||||
imagegen_request_id: None,
|
||||
generation_id: None,
|
||||
image_metadata: Default::default(),
|
||||
});
|
||||
let expected_completed_item = ExtensionItem::ImageGeneration(ImageGenerationItem {
|
||||
id: "call-image".to_string(),
|
||||
@@ -636,6 +637,7 @@ mod tests {
|
||||
input_images: Vec::new(),
|
||||
imagegen_request_id: None,
|
||||
generation_id: None,
|
||||
image_metadata: Default::default(),
|
||||
});
|
||||
codex_tools::TurnItemEmitter::emit_started(
|
||||
&emitter,
|
||||
@@ -663,6 +665,7 @@ mod tests {
|
||||
saved_path: Some(expected_path.clone()),
|
||||
input_images: Vec::new(),
|
||||
generation_id: None,
|
||||
image_metadata: Default::default(),
|
||||
})],
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user