mirror of
https://github.com/openai/codex.git
synced 2026-10-18 17:18:52 +00:00
Enable parallel tool calls for all model prompts (#38499)
## What changed - Set `parallel_tool_calls` for regular and remote compaction prompts without consulting model metadata. - Remove `supports_parallel_tool_calls` from `ModelInfo`, the bundled model catalog, and related fixtures. - Preserve the existing Responses Lite behavior that disables parallel tool calls at request construction. GitOrigin-RevId: 49552bdf97e71fa57325abb49f8adc0c88f1401a
This commit is contained in:
@@ -53,7 +53,6 @@ fn preset_to_info(preset: &ModelPreset, priority: i32) -> ModelInfo {
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(272_000),
|
||||
max_context_window: None,
|
||||
|
||||
@@ -188,7 +188,6 @@ async fn list_models_uses_chatgpt_remote_catalog_as_source_of_truth() -> Result<
|
||||
"default_verbosity": null,
|
||||
"apply_patch_tool_type": null,
|
||||
"truncation_policy": {"mode": "bytes", "limit": 10_000},
|
||||
"supports_parallel_tool_calls": false,
|
||||
"supports_image_detail_original": false,
|
||||
"multi_agent_version": "v2",
|
||||
"context_window": 272_000,
|
||||
|
||||
@@ -212,7 +212,6 @@ mod tests {
|
||||
"default_verbosity": null,
|
||||
"apply_patch_tool_type": null,
|
||||
"truncation_policy": {"mode": "bytes", "limit": 10_000},
|
||||
"supports_parallel_tool_calls": false,
|
||||
"supports_image_detail_original": false,
|
||||
"context_window": 272_000,
|
||||
"experimental_supported_tools": [],
|
||||
|
||||
@@ -91,7 +91,6 @@ async fn models_client_hits_models_endpoint() {
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(272_000),
|
||||
max_context_window: None,
|
||||
|
||||
@@ -264,7 +264,6 @@ fn test_model_info() -> ModelInfo {
|
||||
"default_verbosity": null,
|
||||
"apply_patch_tool_type": null,
|
||||
"truncation_policy": {"mode": "bytes", "limit": 10000},
|
||||
"supports_parallel_tool_calls": false,
|
||||
"supports_image_detail_original": false,
|
||||
"context_window": 272000,
|
||||
"auto_compact_token_limit": null,
|
||||
|
||||
@@ -63,7 +63,7 @@ pub(super) async fn run_remote_compact_attempt(
|
||||
let prompt = Prompt {
|
||||
input: prompt_input,
|
||||
tools: tool_router.model_visible_specs(),
|
||||
parallel_tool_calls: turn_context.model_info.supports_parallel_tool_calls,
|
||||
parallel_tool_calls: true,
|
||||
base_instructions,
|
||||
output_schema: None,
|
||||
output_schema_strict: true,
|
||||
|
||||
@@ -78,7 +78,7 @@ pub(super) async fn run_remote_compact_v2_attempt(
|
||||
let prompt = Prompt {
|
||||
input,
|
||||
tools: tool_router.model_visible_specs(),
|
||||
parallel_tool_calls: turn_context.model_info.supports_parallel_tool_calls,
|
||||
parallel_tool_calls: true,
|
||||
base_instructions,
|
||||
output_schema: None,
|
||||
output_schema_strict: true,
|
||||
|
||||
@@ -1300,7 +1300,7 @@ pub(crate) fn build_prompt(
|
||||
Prompt {
|
||||
input,
|
||||
tools: router.model_visible_specs(),
|
||||
parallel_tool_calls: turn_context.model_info.supports_parallel_tool_calls,
|
||||
parallel_tool_calls: true,
|
||||
base_instructions,
|
||||
output_schema: turn_context.final_output_json_schema.clone(),
|
||||
output_schema_strict: !crate::guardian::is_guardian_reviewer_source(
|
||||
|
||||
@@ -282,7 +282,6 @@ fn remote_model_with_auto_review_override(slug: &str, review_model: &str) -> Mod
|
||||
apply_patch_tool_type: Some(ApplyPatchToolType::Freeform),
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(272_000),
|
||||
max_context_window: None,
|
||||
|
||||
@@ -2499,7 +2499,6 @@ async fn responses_lite_sets_all_turns_context_and_disables_parallel_tool_calls(
|
||||
let TestCodex { codex, .. } = test_codex()
|
||||
.with_model_info_override("gpt-5.4", |model_info| {
|
||||
model_info.use_responses_lite = true;
|
||||
model_info.supports_parallel_tool_calls = true;
|
||||
})
|
||||
.build(&server)
|
||||
.await?;
|
||||
|
||||
@@ -135,7 +135,6 @@ fn test_model_info(
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(272_000),
|
||||
max_context_window: None,
|
||||
@@ -1207,7 +1206,6 @@ async fn model_switch_to_smaller_model_updates_token_context_window() -> Result<
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(large_context_window),
|
||||
max_context_window: None,
|
||||
|
||||
@@ -523,7 +523,6 @@ fn test_remote_model(slug: &str, priority: i32) -> ModelInfo {
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(272_000),
|
||||
max_context_window: None,
|
||||
|
||||
@@ -656,7 +656,6 @@ async fn remote_model_friendly_personality_instructions_with_feature() -> anyhow
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(128_000),
|
||||
max_context_window: None,
|
||||
@@ -781,7 +780,6 @@ async fn user_turn_personality_remote_model_template_includes_update_message() -
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(128_000),
|
||||
max_context_window: None,
|
||||
|
||||
@@ -521,7 +521,6 @@ async fn remote_models_remote_model_uses_unified_exec() -> Result<()> {
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(272_000),
|
||||
max_context_window: None,
|
||||
@@ -784,7 +783,6 @@ async fn remote_models_apply_legacy_instructions() -> Result<()> {
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(272_000),
|
||||
max_context_window: None,
|
||||
@@ -1357,7 +1355,6 @@ fn test_remote_model_with_policy(
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy,
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(272_000),
|
||||
max_context_window: None,
|
||||
|
||||
@@ -532,7 +532,6 @@ async fn responses_lite_compact_request_uses_lite_transport_contract() -> Result
|
||||
let mut builder = test_codex()
|
||||
.with_model_info_override("gpt-5.4", |model_info| {
|
||||
model_info.use_responses_lite = true;
|
||||
model_info.supports_parallel_tool_calls = true;
|
||||
})
|
||||
.with_config(|config| {
|
||||
let _ = config.features.disable(Feature::RemoteCompactionV2);
|
||||
|
||||
@@ -2281,7 +2281,6 @@ async fn stdio_image_responses_are_sanitized_for_text_only_model() -> anyhow::Re
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(272_000),
|
||||
max_context_window: None,
|
||||
|
||||
@@ -97,7 +97,6 @@ fn test_model_info(
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(272_000),
|
||||
max_context_window: None,
|
||||
|
||||
@@ -1641,7 +1641,6 @@ async fn view_image_tool_returns_unsupported_message_for_text_only_model() -> an
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(272_000),
|
||||
max_context_window: None,
|
||||
|
||||
@@ -547,7 +547,6 @@ mod tests {
|
||||
"default_verbosity": null,
|
||||
"apply_patch_tool_type": null,
|
||||
"truncation_policy": {"mode": "bytes", "limit": 10_000},
|
||||
"supports_parallel_tool_calls": false,
|
||||
"supports_image_detail_original": false,
|
||||
"context_window": 272_000,
|
||||
"max_context_window": 272_000,
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
"mode": "tokens",
|
||||
"limit": 10000
|
||||
},
|
||||
"supports_parallel_tool_calls": true,
|
||||
"tool_mode": "code_mode_only",
|
||||
"multi_agent_version": "v2",
|
||||
"use_responses_lite": true,
|
||||
@@ -131,7 +130,6 @@
|
||||
"mode": "tokens",
|
||||
"limit": 10000
|
||||
},
|
||||
"supports_parallel_tool_calls": true,
|
||||
"tool_mode": "code_mode_only",
|
||||
"multi_agent_version": "v2",
|
||||
"use_responses_lite": true,
|
||||
@@ -244,7 +242,6 @@
|
||||
"mode": "tokens",
|
||||
"limit": 10000
|
||||
},
|
||||
"supports_parallel_tool_calls": true,
|
||||
"tool_mode": "code_mode_only",
|
||||
"multi_agent_version": "v1",
|
||||
"use_responses_lite": true,
|
||||
@@ -353,7 +350,6 @@
|
||||
"mode": "tokens",
|
||||
"limit": 10000
|
||||
},
|
||||
"supports_parallel_tool_calls": true,
|
||||
"tool_mode": null,
|
||||
"multi_agent_version": null,
|
||||
"use_responses_lite": false,
|
||||
@@ -460,7 +456,6 @@
|
||||
"mode": "tokens",
|
||||
"limit": 10000
|
||||
},
|
||||
"supports_parallel_tool_calls": true,
|
||||
"tool_mode": null,
|
||||
"multi_agent_version": null,
|
||||
"use_responses_lite": false,
|
||||
@@ -565,7 +560,6 @@
|
||||
"mode": "tokens",
|
||||
"limit": 10000
|
||||
},
|
||||
"supports_parallel_tool_calls": true,
|
||||
"tool_mode": null,
|
||||
"multi_agent_version": null,
|
||||
"use_responses_lite": false,
|
||||
@@ -665,7 +659,6 @@
|
||||
"mode": "bytes",
|
||||
"limit": 10000
|
||||
},
|
||||
"supports_parallel_tool_calls": true,
|
||||
"tool_mode": null,
|
||||
"multi_agent_version": null,
|
||||
"use_responses_lite": false,
|
||||
@@ -762,7 +755,6 @@
|
||||
"mode": "tokens",
|
||||
"limit": 10000
|
||||
},
|
||||
"supports_parallel_tool_calls": true,
|
||||
"tool_mode": null,
|
||||
"multi_agent_version": null,
|
||||
"use_responses_lite": false,
|
||||
|
||||
@@ -66,7 +66,6 @@ fn remote_model_with_visibility(
|
||||
"default_verbosity": null,
|
||||
"apply_patch_tool_type": null,
|
||||
"truncation_policy": {"mode": "bytes", "limit": 10_000},
|
||||
"supports_parallel_tool_calls": false,
|
||||
"supports_image_detail_original": false,
|
||||
"context_window": 272_000,
|
||||
"max_context_window": 272_000,
|
||||
@@ -746,7 +745,6 @@ async fn get_model_info_uses_custom_catalog() {
|
||||
assert_eq!(model_info.display_name, "Overlay");
|
||||
assert_eq!(model_info.context_window, Some(272_000));
|
||||
assert!(model_info.supports_image_detail_original);
|
||||
assert!(!model_info.supports_parallel_tool_calls);
|
||||
assert!(!model_info.used_fallback_model_metadata);
|
||||
}
|
||||
|
||||
|
||||
@@ -163,7 +163,6 @@ pub fn model_info_from_slug(slug: &str) -> ModelInfo {
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: WebSearchToolType::Text,
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: Some(272_000),
|
||||
max_context_window: Some(272_000),
|
||||
|
||||
@@ -420,7 +420,6 @@ pub struct ModelInfo {
|
||||
#[serde(default)]
|
||||
pub web_search_tool_type: WebSearchToolType,
|
||||
pub truncation_policy: TruncationPolicyConfig,
|
||||
pub supports_parallel_tool_calls: bool,
|
||||
#[serde(default)]
|
||||
pub supports_image_detail_original: bool,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -883,7 +882,6 @@ mod tests {
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: WebSearchToolType::Text,
|
||||
truncation_policy: TruncationPolicyConfig::bytes(/*limit*/ 10_000),
|
||||
supports_parallel_tool_calls: false,
|
||||
supports_image_detail_original: false,
|
||||
context_window: None,
|
||||
max_context_window: None,
|
||||
@@ -1455,7 +1453,6 @@ mod tests {
|
||||
"mode": "bytes",
|
||||
"limit": 10000
|
||||
},
|
||||
"supports_parallel_tool_calls": false,
|
||||
"supports_image_detail_original": false,
|
||||
"context_window": null,
|
||||
"auto_compact_token_limit": null,
|
||||
|
||||
@@ -27,7 +27,6 @@ fn model_info() -> ModelInfo {
|
||||
"mode": "bytes",
|
||||
"limit": 10000
|
||||
},
|
||||
"supports_parallel_tool_calls": false,
|
||||
"supports_image_detail_original": true,
|
||||
"context_window": null,
|
||||
"auto_compact_token_limit": null,
|
||||
|
||||
@@ -36,7 +36,6 @@ fn model_with_shell_type(shell_type: ConfigShellToolType) -> ModelInfo {
|
||||
apply_patch_tool_type: None,
|
||||
web_search_tool_type: Default::default(),
|
||||
truncation_policy: TruncationPolicyConfig::tokens(/*limit*/ 1024),
|
||||
supports_parallel_tool_calls: true,
|
||||
supports_image_detail_original: false,
|
||||
context_window: None,
|
||||
max_context_window: None,
|
||||
|
||||
@@ -282,7 +282,6 @@ fn test_model_info(slug: &str, priority: i32, supports_fast_mode: bool) -> Model
|
||||
"default_verbosity": null,
|
||||
"apply_patch_tool_type": null,
|
||||
"truncation_policy": {"mode": "bytes", "limit": 10_000},
|
||||
"supports_parallel_tool_calls": false,
|
||||
"supports_image_detail_original": false,
|
||||
"context_window": 272_000,
|
||||
"experimental_supported_tools": [],
|
||||
|
||||
Reference in New Issue
Block a user