mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Always enable original image detail on supported models (#17665)
## Summary This PR removes `image_detail_original` as a runtime experiment and makes original image detail available whenever the selected model supports it. Concretely, this change: - drops the `image_detail_original` feature flag from the feature registry and generated config schema - makes tool-emitted image detail depend only on `ModelInfo.supports_image_detail_original` - updates `view_image` and `code_mode`/`js_repl` image emission to use that capability check directly - removes now-redundant experiment-specific tests and instruction coverage - keeps backward compatibility for existing configs by silently ignoring a stale `features.image_detail_original` entry The net effect is that `detail: "original"` is always available on supported models, without requiring an experiment toggle.
This commit is contained in:
@@ -1714,7 +1714,7 @@ fn emitted_image_content_item(
|
||||
) -> FunctionCallOutputContentItem {
|
||||
FunctionCallOutputContentItem::InputImage {
|
||||
image_url,
|
||||
detail: normalize_output_image_detail(turn.features.get(), &turn.model_info, detail),
|
||||
detail: normalize_output_image_detail(&turn.model_info, detail),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ use super::*;
|
||||
use crate::codex::make_session_and_context;
|
||||
use crate::codex::make_session_and_context_with_dynamic_tools_and_rx;
|
||||
use crate::turn_diff_tracker::TurnDiffTracker;
|
||||
use codex_features::Feature;
|
||||
use codex_protocol::dynamic_tools::DynamicToolCallOutputContentItem;
|
||||
use codex_protocol::dynamic_tools::DynamicToolResponse;
|
||||
use codex_protocol::dynamic_tools::DynamicToolSpec;
|
||||
@@ -295,42 +294,8 @@ async fn emitted_image_content_item_drops_unsupported_explicit_detail() {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn emitted_image_content_item_does_not_force_original_when_enabled() {
|
||||
async fn emitted_image_content_item_allows_explicit_original_detail_when_supported() {
|
||||
let (_session, mut turn) = make_session_and_context().await;
|
||||
Arc::make_mut(&mut turn.config)
|
||||
.features
|
||||
.enable(Feature::ImageDetailOriginal)
|
||||
.expect("test config should allow feature update");
|
||||
turn.features
|
||||
.enable(Feature::ImageDetailOriginal)
|
||||
.expect("test turn features should allow feature update");
|
||||
turn.model_info.supports_image_detail_original = true;
|
||||
|
||||
let content_item = emitted_image_content_item(
|
||||
&turn,
|
||||
"data:image/png;base64,AAA".to_string(),
|
||||
/*detail*/ None,
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
content_item,
|
||||
FunctionCallOutputContentItem::InputImage {
|
||||
image_url: "data:image/png;base64,AAA".to_string(),
|
||||
detail: None,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn emitted_image_content_item_allows_explicit_original_detail_when_enabled() {
|
||||
let (_session, mut turn) = make_session_and_context().await;
|
||||
Arc::make_mut(&mut turn.config)
|
||||
.features
|
||||
.enable(Feature::ImageDetailOriginal)
|
||||
.expect("test config should allow feature update");
|
||||
turn.features
|
||||
.enable(Feature::ImageDetailOriginal)
|
||||
.expect("test turn features should allow feature update");
|
||||
turn.model_info.supports_image_detail_original = true;
|
||||
|
||||
let content_item = emitted_image_content_item(
|
||||
@@ -349,7 +314,7 @@ async fn emitted_image_content_item_allows_explicit_original_detail_when_enabled
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn emitted_image_content_item_drops_explicit_original_detail_when_disabled() {
|
||||
async fn emitted_image_content_item_drops_explicit_original_detail_when_unsupported() {
|
||||
let (_session, turn) = make_session_and_context().await;
|
||||
|
||||
let content_item = emitted_image_content_item(
|
||||
|
||||
Reference in New Issue
Block a user