Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions codex-rs/core/src/codex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1982,12 +1982,14 @@ async fn run_turn(
let mut base_instructions = turn_context.base_instructions.clone();
if parallel_tool_calls {
static INSTRUCTIONS: &str = include_str!("../templates/parallel/instructions.md");
static INSERTION_SPOT: &str = "## Editing constraints";
base_instructions
.as_mut()
.map(|base| base.replace(INSERTION_SPOT, INSTRUCTIONS));
if let Some(family) =
find_family_for_model(&sess.state.lock().await.session_configuration.model)
{
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(),
Expand Down
3 changes: 1 addition & 2 deletions codex-rs/core/templates/parallel/instructions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

## Exploration and reading files

- **Think first.** Before any tool call, decide ALL files/resources you will need.
Expand All @@ -10,5 +11,3 @@
* 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`.

## Editing constraints
Loading