Compare commits

...

4 Commits

Author SHA1 Message Date
Aishanee Shah a8d4d944e8 test: update local-executor tests for relative path preference 2026-02-26 20:42:26 +00:00
Aishanee Shah 358ca8092a revert: documentation changes for path preference 2026-02-26 20:33:17 +00:00
Aishanee Shah 69028570ed docs: prefer relative paths in tool documentation and system prompt 2026-02-26 20:26:08 +00:00
Aishanee Shah f593928cd6 feat(tools): prefer relative paths in tool descriptions and interfaces 2026-02-26 20:24:22 +00:00
7 changed files with 25 additions and 21 deletions
@@ -653,7 +653,7 @@ describe('LocalAgentExecutor', () => {
expect(systemInstruction).toContain(
'You are running in a non-interactive mode',
);
expect(systemInstruction).toContain('Always use absolute paths');
expect(systemInstruction).toContain('Prefer relative paths');
const { modelConfigKey } = getMockMessageParams(0);
expect(modelConfigKey.model).toBe(getModelConfigAlias(definition));
+1 -1
View File
@@ -1199,7 +1199,7 @@ export class LocalAgentExecutor<TOutput extends z.ZodTypeAny> {
Important Rules:
* You are running in a non-interactive mode. You CANNOT ask the user for input or clarification.
* Work systematically using available tools to complete your task.
* Always use absolute paths for file operations. Construct them using the provided "Environment Context".`;
* Prefer relative paths (relative to workspace root) for file operations. Construct them using the provided "Environment Context".`;
if (this.definition.outputConfig) {
finalPrompt += `
@@ -592,7 +592,7 @@ exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snaps
"type": "string",
},
"dir_path": {
"description": "(OPTIONAL) The path of the directory to run the command in. If not provided, the project root directory is used. Must be a directory within the workspace and must already exist.",
"description": "(OPTIONAL) The path of the directory to run the command in (relative to workspace root preferred). If not provided, the project root directory is used. Must be a directory within the workspace and must already exist.",
"type": "string",
},
"is_background": {
@@ -996,7 +996,7 @@ exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview >
"type": "boolean",
},
"dir_path": {
"description": "Optional: The absolute path to the directory to search within. If omitted, searches the root directory.",
"description": "Optional: The path to the directory to search within (relative to workspace root preferred). If omitted, searches the root directory.",
"type": "string",
},
"pattern": {
@@ -1046,7 +1046,7 @@ exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview >
"parametersJsonSchema": {
"properties": {
"dir_path": {
"description": "Optional: The absolute path to the directory to search within. If omitted, searches the current working directory.",
"description": "Optional: The path to the directory to search within (relative to workspace root preferred). If omitted, searches the current working directory.",
"type": "string",
},
"exclude_pattern": {
@@ -1109,7 +1109,7 @@ exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview >
"type": "integer",
},
"dir_path": {
"description": "Directory or file to search. Directories are searched recursively. Relative paths are resolved against current working directory. Defaults to current working directory ('.') if omitted.",
"description": "Directory or file to search (relative to workspace root preferred). Directories are searched recursively. Relative paths are resolved against current working directory. Defaults to current working directory ('.') if omitted.",
"type": "string",
},
"exclude_pattern": {
@@ -1162,7 +1162,7 @@ exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview >
"parametersJsonSchema": {
"properties": {
"dir_path": {
"description": "The path to the directory to list",
"description": "The path to the directory to list (relative to workspace root preferred).",
"type": "string",
},
"file_filtering_options": {
@@ -1206,7 +1206,7 @@ exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview >
"type": "number",
},
"file_path": {
"description": "The path to the file to read.",
"description": "The path to the file to read (relative to workspace root preferred).",
"type": "string",
},
"start_line": {
@@ -1300,7 +1300,7 @@ The user has the ability to modify the \`new_string\` content. If modified, this
"type": "boolean",
},
"file_path": {
"description": "The path to the file to modify.",
"description": "The path to the file to modify (relative to workspace root preferred).",
"type": "string",
},
"instruction": {
@@ -1355,7 +1355,7 @@ exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview >
"type": "string",
},
"dir_path": {
"description": "(OPTIONAL) The path of the directory to run the command in. If not provided, the project root directory is used. Must be a directory within the workspace and must already exist.",
"description": "(OPTIONAL) The path of the directory to run the command in (relative to workspace root preferred). If not provided, the project root directory is used. Must be a directory within the workspace and must already exist.",
"type": "string",
},
"is_background": {
@@ -1421,7 +1421,7 @@ exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview >
"type": "string",
},
"file_path": {
"description": "Path to the file.",
"description": "Path to the file (relative to workspace root preferred).",
"type": "string",
},
},
@@ -96,7 +96,7 @@ export function getShellDeclaration(
dir_path: {
type: 'string',
description:
'(OPTIONAL) The path of the directory to run the command in. If not provided, the project root directory is used. Must be a directory within the workspace and must already exist.',
'(OPTIONAL) The path of the directory to run the command in (relative to workspace root preferred). If not provided, the project root directory is used. Must be a directory within the workspace and must already exist.',
},
is_background: {
type: 'boolean',
@@ -43,7 +43,8 @@ export const GEMINI_3_SET: CoreToolSet = {
type: 'object',
properties: {
file_path: {
description: 'The path to the file to read.',
description:
'The path to the file to read (relative to workspace root preferred).',
type: 'string',
},
start_line: {
@@ -68,7 +69,8 @@ export const GEMINI_3_SET: CoreToolSet = {
type: 'object',
properties: {
file_path: {
description: 'Path to the file.',
description:
'Path to the file (relative to workspace root preferred).',
type: 'string',
},
content: {
@@ -94,7 +96,7 @@ export const GEMINI_3_SET: CoreToolSet = {
},
dir_path: {
description:
'Optional: The absolute path to the directory to search within. If omitted, searches the current working directory.',
'Optional: The path to the directory to search within (relative to workspace root preferred). If omitted, searches the current working directory.',
type: 'string',
},
include_pattern: {
@@ -141,7 +143,7 @@ export const GEMINI_3_SET: CoreToolSet = {
},
dir_path: {
description:
"Directory or file to search. Directories are searched recursively. Relative paths are resolved against current working directory. Defaults to current working directory ('.') if omitted.",
"Directory or file to search (relative to workspace root preferred). Directories are searched recursively. Relative paths are resolved against current working directory. Defaults to current working directory ('.') if omitted.",
type: 'string',
},
include_pattern: {
@@ -222,7 +224,7 @@ export const GEMINI_3_SET: CoreToolSet = {
},
dir_path: {
description:
'Optional: The absolute path to the directory to search within. If omitted, searches the root directory.',
'Optional: The path to the directory to search within (relative to workspace root preferred). If omitted, searches the root directory.',
type: 'string',
},
case_sensitive: {
@@ -253,7 +255,8 @@ export const GEMINI_3_SET: CoreToolSet = {
type: 'object',
properties: {
dir_path: {
description: 'The path to the directory to list',
description:
'The path to the directory to list (relative to workspace root preferred).',
type: 'string',
},
ignore: {
@@ -296,7 +299,8 @@ The user has the ability to modify the \`new_string\` content. If modified, this
type: 'object',
properties: {
file_path: {
description: 'The path to the file to modify.',
description:
'The path to the file to modify (relative to workspace root preferred).',
type: 'string',
},
instruction: {
+1 -1
View File
@@ -23,7 +23,7 @@ import { resolveToolDeclaration } from './definitions/resolver.js';
*/
export interface LSToolParams {
/**
* The absolute path to the directory to list
* The path to the directory to list (relative to workspace root preferred)
*/
dir_path: string;
+1 -1
View File
@@ -54,7 +54,7 @@ import { detectOmissionPlaceholders } from './omissionPlaceholderDetector.js';
*/
export interface WriteFileToolParams {
/**
* The absolute path to the file to write to
* The path to the file to write to (relative to workspace root preferred)
*/
file_path: string;