From 32dd298351057aa56829663332e13954b1d2f953 Mon Sep 17 00:00:00 2001 From: Keir Mierle Date: Sat, 14 Jun 2025 21:16:11 -0700 Subject: fix: Push tool calls to absolute paths (#1055) (#1057) Make several changes to guide the model to request absolute paths, reducing frequent accidental relative path tool call failures. - Switch the parameter name: path --> absolute_path. - Update the tool definition to strongly require an absolute path. - Update the system prompt to indicate absolute paths are required. - Update the system prompt tool use examples to use absolute paths. Test case: Open GC in GC: "Locate the primary file calling genai" - Expected: Model opens files with absolute path, successfully. - Actual (pre-patch): Failure, attempts to read with relative path. - Actual (post-patch): Success, attempts to read with absolute path. --- docs/core/tools-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/core') diff --git a/docs/core/tools-api.md b/docs/core/tools-api.md index 92a09661..3c41820c 100644 --- a/docs/core/tools-api.md +++ b/docs/core/tools-api.md @@ -34,7 +34,7 @@ The core comes with a suite of pre-defined tools, typically found in `packages/c - **File System Tools:** - `LSTool` (`ls.ts`): Lists directory contents. - - `ReadFileTool` (`read-file.ts`): Reads the content of a single file. + - `ReadFileTool` (`read-file.ts`): Reads the content of a single file. It takes an `absolute_path` parameter, which must be an absolute path. - `WriteFileTool` (`write-file.ts`): Writes content to a file. - `GrepTool` (`grep.ts`): Searches for patterns in files. - `GlobTool` (`glob.ts`): Finds files matching glob patterns. -- cgit v1.2.3