Don't enforce leading slash since that's not true on Windows (#3545)

This commit is contained in:
Tommaso Sciortino
2025-07-08 09:30:49 -07:00
committed by GitHub
parent 4dab31f1c8
commit 5c759d48c7
2 changed files with 3 additions and 4 deletions

View File

@@ -74,7 +74,7 @@ describe('ReadFileTool', () => {
it('should return error for relative path', () => {
const params: ReadFileToolParams = { absolute_path: 'test.txt' };
expect(tool.validateToolParams(params)).toBe(
`params/absolute_path must match pattern "^/"`,
`File path must be absolute, but was relative: test.txt. You must provide an absolute path.`,
);
});
@@ -144,10 +144,10 @@ describe('ReadFileTool', () => {
const params: ReadFileToolParams = { absolute_path: 'relative/path.txt' };
const result = await tool.execute(params, abortSignal);
expect(result.llmContent).toBe(
'Error: Invalid parameters provided. Reason: params/absolute_path must match pattern "^/"',
'Error: Invalid parameters provided. Reason: File path must be absolute, but was relative: relative/path.txt. You must provide an absolute path.',
);
expect(result.returnDisplay).toBe(
'params/absolute_path must match pattern "^/"',
'File path must be absolute, but was relative: relative/path.txt. You must provide an absolute path.',
);
});