mirror of
https://github.com/openai/codex.git
synced 2026-04-28 02:11:08 +03:00
Don't remove image placeholders when submitting
This commit is contained in:
@@ -211,7 +211,11 @@ impl ChatComposer {
|
||||
Ok((w, h)) => {
|
||||
tracing::info!("OK: {pasted}");
|
||||
let format_label = get_img_format_label(path_buf.clone());
|
||||
self.attach_image(path_buf, w, h, &format_label)
|
||||
if self.attach_image(path_buf, w, h, &format_label) {
|
||||
self.pending_pastes.push(("image".into(), "image".into()));
|
||||
return true;
|
||||
}
|
||||
false
|
||||
}
|
||||
Err(err) => {
|
||||
tracing::info!("ERR: {err}");
|
||||
@@ -639,13 +643,6 @@ impl ChatComposer {
|
||||
}
|
||||
self.pending_pastes.clear();
|
||||
|
||||
// Strip image placeholders from the submitted text; images are retrieved via take_recent_submission_images()
|
||||
for (placeholder, _) in &self.attached_images {
|
||||
if text.contains(placeholder) {
|
||||
text = text.replace(placeholder, "");
|
||||
}
|
||||
}
|
||||
|
||||
text = text.trim().to_string();
|
||||
if !text.is_empty() {
|
||||
self.history.record_local_submission(&text);
|
||||
|
||||
Reference in New Issue
Block a user