From 582a3cb7d834f525b477dc9ddd361c3dd488f5e2 Mon Sep 17 00:00:00 2001 From: Curtis 'Fjord' Hawthorne Date: Thu, 5 Mar 2026 15:57:50 -0800 Subject: [PATCH] Promote image_detail_original to experimental --- codex-rs/core/src/features.rs | 25 ++++++++++++++- ..._features_popup_image_detail_original.snap | 14 ++++++++ codex-rs/tui/src/chatwidget/tests.rs | 32 +++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__experimental_features_popup_image_detail_original.snap diff --git a/codex-rs/core/src/features.rs b/codex-rs/core/src/features.rs index 8aa5e181d41..e378f894dab 100644 --- a/codex-rs/core/src/features.rs +++ b/codex-rs/core/src/features.rs @@ -555,7 +555,11 @@ pub const FEATURES: &[FeatureSpec] = &[ FeatureSpec { id: Feature::ImageDetailOriginal, key: "image_detail_original", - stage: Stage::UnderDevelopment, + stage: Stage::Experimental { + name: "Original image detail", + menu_description: "Send tool-emitted images with `detail: \"original\"` on supported models so the model sees the full-resolution image instead of a resized approximation. This affects tools like `view_image` and `js_repl`, not images attached directly in the UI. It is particularly important for CUA or localization tasks that depend on small text, precise layout, or exact UI targets.", + announcement: "NEW: Original image detail is now available in /experimental. Enable it to preserve full-resolution screenshots for CUA and localization tasks on supported models.", + }, default_enabled: false, }, FeatureSpec { @@ -882,6 +886,25 @@ mod tests { assert_eq!(Feature::ImageGeneration.default_enabled(), false); } + #[test] + fn image_detail_original_is_experimental_and_user_toggleable() { + let spec = Feature::ImageDetailOriginal.info(); + let stage = spec.stage; + + assert!(matches!(stage, Stage::Experimental { .. })); + assert_eq!( + stage.experimental_menu_name(), + Some("Original image detail") + ); + assert_eq!( + stage.experimental_menu_description(), + Some( + "Send tool-emitted images with `detail: \"original\"` on supported models so the model sees the full-resolution image instead of a resized approximation. This affects tools like `view_image` and `js_repl`, not images attached directly in the UI. It is particularly important for CUA or localization tasks that depend on small text, precise layout, or exact UI targets." + ) + ); + assert_eq!(Feature::ImageDetailOriginal.default_enabled(), false); + } + #[test] fn collab_is_legacy_alias_for_multi_agent() { assert_eq!(feature_for_key("multi_agent"), Some(Feature::Collab)); diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__experimental_features_popup_image_detail_original.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__experimental_features_popup_image_detail_original.snap new file mode 100644 index 00000000000..714b800fc4d --- /dev/null +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__experimental_features_popup_image_detail_original.snap @@ -0,0 +1,14 @@ +--- +source: tui/src/chatwidget/tests.rs +expression: popup +--- + Experimental features + Toggle experimental features. Changes are saved to config.toml. + +› [ ] Original image detail Send tool-emitted images with `detail: "original"` on supported models so the model sees + the full-resolution image instead of a resized approximation. This affects tools like + `view_image` and `js_repl`, not images attached directly in the UI. It is particularly + important for CUA or localization tasks that depend on small text, precise layout, or + exact UI targets. + + Press space to select or enter to save for next conversation diff --git a/codex-rs/tui/src/chatwidget/tests.rs b/codex-rs/tui/src/chatwidget/tests.rs index 18cb2dd234e..bade1ec06c5 100644 --- a/codex-rs/tui/src/chatwidget/tests.rs +++ b/codex-rs/tui/src/chatwidget/tests.rs @@ -6854,6 +6854,38 @@ async fn experimental_popup_shows_js_repl_node_requirement() { ); } +#[tokio::test] +async fn experimental_features_popup_image_detail_original_snapshot() { + let (mut chat, _rx, _op_rx) = make_chatwidget_manual(None).await; + + let spec = FEATURES + .iter() + .find(|spec| spec.id == Feature::ImageDetailOriginal) + .expect("expected image_detail_original feature spec"); + let name = spec + .stage + .experimental_menu_name() + .expect("expected image_detail_original experimental name"); + let description = spec + .stage + .experimental_menu_description() + .expect("expected image_detail_original experimental description"); + + let view = ExperimentalFeaturesView::new( + vec![ExperimentalFeatureItem { + feature: Feature::ImageDetailOriginal, + name: name.to_string(), + description: description.to_string(), + enabled: false, + }], + chat.app_event_tx.clone(), + ); + chat.bottom_pane.show_view(Box::new(view)); + + let popup = render_bottom_popup(&chat, 120); + assert_snapshot!("experimental_features_popup_image_detail_original", popup); +} + #[tokio::test] async fn multi_agent_enable_prompt_snapshot() { let (mut chat, _rx, _op_rx) = make_chatwidget_manual(None).await;