mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
[imagegen] preserve image generation start events
This commit is contained in:
@@ -893,6 +893,7 @@ pub enum ResponseItem {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
revised_prompt: Option<String>,
|
||||
#[serde(default)]
|
||||
result: String,
|
||||
},
|
||||
#[serde(alias = "compaction_summary")]
|
||||
@@ -1847,6 +1848,26 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn response_item_parses_in_progress_image_generation_call_without_result() {
|
||||
let item = serde_json::from_value::<ResponseItem>(serde_json::json!({
|
||||
"id": "ig_123",
|
||||
"type": "image_generation_call",
|
||||
"status": "in_progress",
|
||||
}))
|
||||
.expect("in-progress image generation item should deserialize");
|
||||
|
||||
assert_eq!(
|
||||
item,
|
||||
ResponseItem::ImageGenerationCall {
|
||||
id: "ig_123".to_string(),
|
||||
status: "in_progress".to_string(),
|
||||
revised_prompt: None,
|
||||
result: String::new(),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn additional_permission_profile_is_empty_when_all_fields_are_none() {
|
||||
assert_eq!(AdditionalPermissionProfile::default().is_empty(), true);
|
||||
|
||||
Reference in New Issue
Block a user