mirror of
https://github.com/openai/codex.git
synced 2026-11-08 20:40:33 +00:00
Normalize image detail for the receiving model (#44249)
## Why Switching models can send images from conversation history with `detail: original` to a model that does not support it. ## What changed Normalize image details on request copies using the receiving model's capabilities. Downgrade `original` to `high` when unsupported, covering user messages and function and custom tool outputs. Preserve stored image details so switching back to a supporting model retains `original`, and continue stripping details for Responses Lite. ## Testing Expand unit coverage across image detail values and model capabilities. Extend integration coverage for model switches within and between turns, text-only models, and resumed and forked threads, including assertions that persisted tool outputs remain unchanged. GitOrigin-RevId: 2561651ea74f045e00f708ae53771a41dcd49c94
This commit is contained in:
@@ -897,7 +897,7 @@ impl ModelClient {
|
||||
service_tier: Option<String>,
|
||||
responses_metadata: &CodexResponsesMetadata,
|
||||
) -> Result<ResponsesApiRequest> {
|
||||
let mut input = prompt.get_formatted_input_for_request(model_info.use_responses_lite);
|
||||
let mut input = prompt.get_formatted_input_for_request(model_info);
|
||||
let is_openai = self.state.provider.info().is_openai();
|
||||
let (instructions, tools) = if model_info.use_responses_lite {
|
||||
// These prompt-only items are rebuilt on every request. Hash their visible payloads
|
||||
|
||||
Reference in New Issue
Block a user