mirror of
https://github.com/openai/codex.git
synced 2026-06-01 19:02:59 +00:00
Preserve image detail in app-server inputs (#20693)
## Summary - Add optional image detail to user image inputs across core, app-server v2, thread history/event mapping, and the generated app-server schemas/types. - Preserve requested detail when serializing Responses image inputs: omitted detail stays on the existing `high` default, while explicit `original` keeps local images on the original-resolution path. - Support `high`/`original` consistently for tool image outputs, including MCP `codex/imageDetail`, code-mode image helpers, and `view_image`.
This commit is contained in:
committed by
GitHub
parent
249d50aafc
commit
8543e39885
@@ -16,7 +16,7 @@ pub fn normalize_output_image_detail(
|
||||
Some(ImageDetail::Original)
|
||||
}
|
||||
Some(ImageDetail::Original) | None => None,
|
||||
Some(ImageDetail::Auto | ImageDetail::Low | ImageDetail::High) => detail,
|
||||
Some(ImageDetail::High) => Some(ImageDetail::High),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,10 +70,6 @@ fn explicit_original_is_dropped_without_model_support() {
|
||||
fn explicit_non_original_detail_is_preserved() {
|
||||
let model_info = model_info();
|
||||
|
||||
assert_eq!(
|
||||
normalize_output_image_detail(&model_info, Some(ImageDetail::Low)),
|
||||
Some(ImageDetail::Low)
|
||||
);
|
||||
assert_eq!(
|
||||
normalize_output_image_detail(&model_info, Some(ImageDetail::High)),
|
||||
Some(ImageDetail::High)
|
||||
@@ -92,7 +88,7 @@ fn sanitize_original_falls_back_to_high_without_support() {
|
||||
},
|
||||
FunctionCallOutputContentItem::InputImage {
|
||||
image_url: "data:image/png;base64,BBB".to_string(),
|
||||
detail: Some(ImageDetail::Low),
|
||||
detail: Some(ImageDetail::High),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -110,7 +106,7 @@ fn sanitize_original_falls_back_to_high_without_support() {
|
||||
},
|
||||
FunctionCallOutputContentItem::InputImage {
|
||||
image_url: "data:image/png;base64,BBB".to_string(),
|
||||
detail: Some(ImageDetail::Low),
|
||||
detail: Some(ImageDetail::High),
|
||||
},
|
||||
]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user