Enabling CWD Saving for Image-Gen (#13607)

Codex now saves the generated image on to your current working
directory.
This commit is contained in:
Won Park authored and GitHub committed 2026-03-06 00:47:21 -08:00
1 parent 6638558b88
commit ee1a20258a
15 files changed
+296 -21

No files matched your search

+6
View File
@@ -1901,6 +1901,9 @@ pub struct ImageGenerationEndEvent {
#[ts(optional)]
pub revised_prompt: Option<String>,
pub result: String,
#[serde(skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub saved_path: Option<String>,
}
// Conversation kept for backward compatibility.
@@ -3274,6 +3277,7 @@ mod tests {
status: "in_progress".into(),
revised_prompt: None,
result: String::new(),
saved_path: None,
}),
};
@@ -3295,6 +3299,7 @@ mod tests {
status: "completed".into(),
revised_prompt: Some("A tiny blue square".into()),
result: "Zm9v".into(),
saved_path: Some("/tmp/ig-1.png".into()),
}),
};
@@ -3306,6 +3311,7 @@ mod tests {
assert_eq!(event.status, "completed");
assert_eq!(event.revised_prompt.as_deref(), Some("A tiny blue square"));
assert_eq!(event.result, "Zm9v");
assert_eq!(event.saved_path.as_deref(), Some("/tmp/ig-1.png"));
}
_ => panic!("expected ImageGenerationEnd event"),
}