Lightweight coding agent that runs in your terminal
Rust
chore: enable parallel tc (#7589)
jif-oai6382dc2338aa
diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rsindex 74ef11c323..8060929149 100644--- a/codex-rs/core/src/codex.rs+++ b/codex-rs/core/src/codex.rs@@ -2174,21 +2174,11 @@ async fn run_turn(.get_model_family().supports_parallel_tool_calls;- // TODO(jif) revert once testing phase is done.- let parallel_tool_calls = model_supports_parallel && sess.enabled(Feature::ParallelToolCalls);- let mut base_instructions = turn_context.base_instructions.clone();- if parallel_tool_calls {- static INSTRUCTIONS: &str = include_str!("../templates/parallel/instructions.md");- let family = turn_context.client.get_model_family();- let mut new_instructions = base_instructions.unwrap_or(family.base_instructions);- new_instructions.push_str(INSTRUCTIONS);- base_instructions = Some(new_instructions);- }let prompt = Prompt {input,tools: router.specs(),- parallel_tool_calls,- base_instructions_override: base_instructions,+ parallel_tool_calls: model_supports_parallel && sess.enabled(Feature::ParallelToolCalls),+ base_instructions_override: turn_context.base_instructions.clone(),output_schema: turn_context.final_output_json_schema.clone(),};diff --git a/codex-rs/core/src/features.rs b/codex-rs/core/src/features.rsindex 69442815e7..43a89480f4 100644--- a/codex-rs/core/src/features.rs+++ b/codex-rs/core/src/features.rs@@ -268,6 +268,12 @@ pub const FEATURES: &[FeatureSpec] = &[stage: Stage::Stable,default_enabled: true,},+ FeatureSpec {+ id: Feature::ParallelToolCalls,+ key: "parallel",+ stage: Stage::Stable,+ default_enabled: true,+ },FeatureSpec {id: Feature::ViewImageTool,key: "view_image_tool",diff --git a/codex-rs/core/src/openai_models/model_family.rs b/codex-rs/core/src/openai_models/model_family.rsindex 33a130cb3d..8a3853d60b 100644--- a/codex-rs/core/src/openai_models/model_family.rs+++ b/codex-rs/core/src/openai_models/model_family.rs@@ -259,7 +259,7 @@ pub fn find_family_for_model(slug: &str) -> ModelFamily {base_instructions: GPT_5_1_CODEX_MAX_INSTRUCTIONS.to_string(),apply_patch_tool_type: Some(ApplyPatchToolType::Freeform),shell_type: ConfigShellToolType::ShellCommand,- supports_parallel_tool_calls: true,+ supports_parallel_tool_calls: false,support_verbosity: false,truncation_policy: TruncationPolicy::Tokens(10_000),context_window: Some(CONTEXT_WINDOW_272K),@@ -275,7 +275,7 @@ pub fn find_family_for_model(slug: &str) -> ModelFamily {base_instructions: GPT_5_CODEX_INSTRUCTIONS.to_string(),apply_patch_tool_type: Some(ApplyPatchToolType::Freeform),shell_type: ConfigShellToolType::ShellCommand,- supports_parallel_tool_calls: true,+ supports_parallel_tool_calls: false,support_verbosity: false,truncation_policy: TruncationPolicy::Tokens(10_000),context_window: Some(CONTEXT_WINDOW_272K),diff --git a/codex-rs/core/templates/parallel/instructions.md b/codex-rs/core/templates/parallel/instructions.mddeleted file mode 100644index 292d585e45..0000000000--- a/codex-rs/core/templates/parallel/instructions.md+++ /dev/null@@ -1,13 +0,0 @@--## Exploration and reading files--- **Think first.** Before any tool call, decide ALL files/resources you will need.-- **Batch everything.** If you need multiple files (even from different places), read them together.-- **multi_tool_use.parallel** Use `multi_tool_use.parallel` to parallelize tool calls and only this.-- **Only make sequential calls if you truly cannot know the next file without seeing a result first.**-- **Workflow:** (a) plan all needed reads → (b) issue one parallel batch → (c) analyze results → (d) repeat if new, unpredictable reads arise.--**Additional notes**:-* Always maximize parallelism. Never read files one-by-one unless logically unavoidable.-* This concern every read/list/search operations including, but not only, `cat`, `rg`, `sed`, `ls`, `git show`, `nl`, `wc`, ...-* Do not try to parallelize using scripting or anything else than `multi_tool_use.parallel`.