diff --git a/codex-rs/core/src/event_mapping_tests.rs b/codex-rs/core/src/event_mapping_tests.rs index df636d4a6b..4cf1b72d5d 100644 --- a/codex-rs/core/src/event_mapping_tests.rs +++ b/codex-rs/core/src/event_mapping_tests.rs @@ -67,7 +67,7 @@ fn parses_user_message_with_text_and_two_images() { #[test] fn skips_local_image_label_text() { let image_url = "data:image/png;base64,abc".to_string(); - let label = codex_protocol::models::local_image_open_tag_text(/*label_number*/ 1); + let label = r#""#.to_string(); let user_text = "Please review this image.".to_string(); let item = ResponseItem::Message { diff --git a/codex-rs/core/tests/suite/image_rollout.rs b/codex-rs/core/tests/suite/image_rollout.rs index 7018274510..23907e9014 100644 --- a/codex-rs/core/tests/suite/image_rollout.rs +++ b/codex-rs/core/tests/suite/image_rollout.rs @@ -161,9 +161,7 @@ async fn copy_paste_local_image_persists_rollout_request_shape() -> anyhow::Resu role: "user".to_string(), content: vec![ ContentItem::InputText { - text: codex_protocol::models::local_image_open_tag_text_with_path( - /*label_number*/ 1, &abs_path, - ), + text: format!(r#""#, abs_path.display()), }, ContentItem::InputImage { image_url, diff --git a/codex-rs/protocol/src/models.rs b/codex-rs/protocol/src/models.rs index 09754e30f3..b570be0909 100644 --- a/codex-rs/protocol/src/models.rs +++ b/codex-rs/protocol/src/models.rs @@ -1026,12 +1026,7 @@ pub fn local_image_label_text(label_number: usize) -> String { format!("[Image #{label_number}]") } -pub fn local_image_open_tag_text(label_number: usize) -> String { - let label = local_image_label_text(label_number); - format!("{LOCAL_IMAGE_OPEN_TAG_PREFIX}{label}{LOCAL_IMAGE_OPEN_TAG_SUFFIX}") -} - -pub fn local_image_open_tag_text_with_path(label_number: usize, path: &std::path::Path) -> String { +fn local_image_open_tag_text_with_path(label_number: usize, path: &std::path::Path) -> String { let label = local_image_label_text(label_number); let path = path .display() diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs index 3c0b5cb462..bc1771599f 100644 --- a/codex-rs/protocol/src/protocol.rs +++ b/codex-rs/protocol/src/protocol.rs @@ -2180,8 +2180,9 @@ pub struct UserMessageEvent { #[serde(default, skip_serializing_if = "Vec::is_empty")] pub image_details: Vec>, /// Local file paths sourced from `UserInput::LocalImage`. These are kept so - /// the UI can reattach images when editing history, and should not be sent - /// to the model or treated as API-ready URLs. + /// the UI can reattach images when editing history. Local image prompts may + /// include a display form of the path, but these should not be treated as + /// API-ready URLs. #[serde(default)] pub local_images: Vec, /// Detail hints for `local_images`, indexed in parallel. Missing entries