diff options
| author | Keir Mierle <[email protected]> | 2025-06-14 21:16:11 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-14 21:16:11 -0700 |
| commit | 32dd298351057aa56829663332e13954b1d2f953 (patch) | |
| tree | 96e3ec6de3309c6717f895a24f30ab954b63c65e /docs/core/tools-api.md | |
| parent | e30e650a77d7b6faaca9d799c508497e59992718 (diff) | |
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.
Diffstat (limited to 'docs/core/tools-api.md')
| -rw-r--r-- | docs/core/tools-api.md | 2 |
1 files changed, 1 insertions, 1 deletions
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. |
