mirror of
https://github.com/openai/codex.git
synced 2026-04-24 22:54:54 +00:00
chore: enable parallel tc (#7589)
This commit is contained in:
@@ -2174,21 +2174,11 @@ async fn run_turn(
|
|||||||
.get_model_family()
|
.get_model_family()
|
||||||
.supports_parallel_tool_calls;
|
.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 {
|
let prompt = Prompt {
|
||||||
input,
|
input,
|
||||||
tools: router.specs(),
|
tools: router.specs(),
|
||||||
parallel_tool_calls,
|
parallel_tool_calls: model_supports_parallel && sess.enabled(Feature::ParallelToolCalls),
|
||||||
base_instructions_override: base_instructions,
|
base_instructions_override: turn_context.base_instructions.clone(),
|
||||||
output_schema: turn_context.final_output_json_schema.clone(),
|
output_schema: turn_context.final_output_json_schema.clone(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -268,6 +268,12 @@ pub const FEATURES: &[FeatureSpec] = &[
|
|||||||
stage: Stage::Stable,
|
stage: Stage::Stable,
|
||||||
default_enabled: true,
|
default_enabled: true,
|
||||||
},
|
},
|
||||||
|
FeatureSpec {
|
||||||
|
id: Feature::ParallelToolCalls,
|
||||||
|
key: "parallel",
|
||||||
|
stage: Stage::Stable,
|
||||||
|
default_enabled: true,
|
||||||
|
},
|
||||||
FeatureSpec {
|
FeatureSpec {
|
||||||
id: Feature::ViewImageTool,
|
id: Feature::ViewImageTool,
|
||||||
key: "view_image_tool",
|
key: "view_image_tool",
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ pub fn find_family_for_model(slug: &str) -> ModelFamily {
|
|||||||
base_instructions: GPT_5_1_CODEX_MAX_INSTRUCTIONS.to_string(),
|
base_instructions: GPT_5_1_CODEX_MAX_INSTRUCTIONS.to_string(),
|
||||||
apply_patch_tool_type: Some(ApplyPatchToolType::Freeform),
|
apply_patch_tool_type: Some(ApplyPatchToolType::Freeform),
|
||||||
shell_type: ConfigShellToolType::ShellCommand,
|
shell_type: ConfigShellToolType::ShellCommand,
|
||||||
supports_parallel_tool_calls: true,
|
supports_parallel_tool_calls: false,
|
||||||
support_verbosity: false,
|
support_verbosity: false,
|
||||||
truncation_policy: TruncationPolicy::Tokens(10_000),
|
truncation_policy: TruncationPolicy::Tokens(10_000),
|
||||||
context_window: Some(CONTEXT_WINDOW_272K),
|
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(),
|
base_instructions: GPT_5_CODEX_INSTRUCTIONS.to_string(),
|
||||||
apply_patch_tool_type: Some(ApplyPatchToolType::Freeform),
|
apply_patch_tool_type: Some(ApplyPatchToolType::Freeform),
|
||||||
shell_type: ConfigShellToolType::ShellCommand,
|
shell_type: ConfigShellToolType::ShellCommand,
|
||||||
supports_parallel_tool_calls: true,
|
supports_parallel_tool_calls: false,
|
||||||
support_verbosity: false,
|
support_verbosity: false,
|
||||||
truncation_policy: TruncationPolicy::Tokens(10_000),
|
truncation_policy: TruncationPolicy::Tokens(10_000),
|
||||||
context_window: Some(CONTEXT_WINDOW_272K),
|
context_window: Some(CONTEXT_WINDOW_272K),
|
||||||
|
|||||||
@@ -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`.
|
|
||||||
Reference in New Issue
Block a user