Include full abs paths of worktrees in system prompt (#32725)
Some MCP servers expose tools that take absolute paths as arguments. To interact with these, the agent needs to know the absolute path to the project directories, not just their names. This PR changes the system prompt to include the full path to each worktree, and updates some tool descriptions to reflect this. Todo: * [x] Run evals, make sure assistant still understand how to specify paths for tools, now that we include abs paths in the system prompt. Release Notes: - Improved the agent's ability to use MPC tools that require absolute paths to files and directories in the project. --------- Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
This commit is contained in:
parent
0433b8859d
commit
a994666888
6 changed files with 63 additions and 57 deletions
|
@ -74,6 +74,7 @@ pub struct UserRulesContext {
|
|||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct WorktreeContext {
|
||||
pub root_name: String,
|
||||
pub abs_path: Arc<Path>,
|
||||
pub rules_file: Option<RulesFileContext>,
|
||||
}
|
||||
|
||||
|
@ -455,6 +456,7 @@ mod test {
|
|||
fn test_assistant_system_prompt_renders() {
|
||||
let worktrees = vec![WorktreeContext {
|
||||
root_name: "path".into(),
|
||||
abs_path: Path::new("/path/to/root").into(),
|
||||
rules_file: Some(RulesFileContext {
|
||||
path_in_worktree: Path::new(".rules").into(),
|
||||
text: "".into(),
|
||||
|
@ -484,6 +486,7 @@ mod test {
|
|||
fn test_assistant_system_prompt_depends_on_enabled_tools() {
|
||||
let worktrees = vec![WorktreeContext {
|
||||
root_name: "path".into(),
|
||||
abs_path: Path::new("/path/to/root").into(),
|
||||
rules_file: None,
|
||||
}];
|
||||
let default_user_rules = vec![];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue