fix: parallel tool call instruction injection (#6893)
This commit is contained in:
parent
10d571f236
commit
4985a7a444
2 changed files with 8 additions and 7 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
## Exploration and reading files
|
||||
|
||||
- **Think first.** Before any tool call, decide ALL files/resources you will need.
|
||||
|
|
@ -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…
Add table
Reference in a new issue