mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Feat/restore image generation history (#15223)
Restore image generation items in resumed thread history
This commit is contained in:
@@ -995,12 +995,13 @@ fn thread_item_to_core(item: &ThreadItem) -> Option<TurnItem> {
|
||||
status,
|
||||
revised_prompt,
|
||||
result,
|
||||
saved_path,
|
||||
} => Some(TurnItem::ImageGeneration(ImageGenerationItem {
|
||||
id: id.clone(),
|
||||
status: status.clone(),
|
||||
revised_prompt: revised_prompt.clone(),
|
||||
result: result.clone(),
|
||||
saved_path: None,
|
||||
saved_path: saved_path.clone(),
|
||||
})),
|
||||
ThreadItem::ContextCompaction { id } => {
|
||||
Some(TurnItem::ContextCompaction(ContextCompactionItem {
|
||||
@@ -1850,6 +1851,7 @@ mod tests {
|
||||
status: "completed".to_string(),
|
||||
revised_prompt: Some("diagram".to_string()),
|
||||
result: "image.png".to_string(),
|
||||
saved_path: None,
|
||||
},
|
||||
ThreadItem::ContextCompaction {
|
||||
id: "compact-1".to_string(),
|
||||
|
||||
@@ -5725,13 +5725,14 @@ impl ChatWidget {
|
||||
status,
|
||||
revised_prompt,
|
||||
result,
|
||||
saved_path,
|
||||
} => {
|
||||
self.on_image_generation_end(ImageGenerationEndEvent {
|
||||
call_id: id,
|
||||
result,
|
||||
revised_prompt,
|
||||
status,
|
||||
saved_path: None,
|
||||
saved_path,
|
||||
});
|
||||
}
|
||||
ThreadItem::EnteredReviewMode { review, .. } => {
|
||||
|
||||
Reference in New Issue
Block a user