Enable tool call type coersion (#477)

* feat: enable tool call type coercion

* fix: tests for type coercion

---------

Co-authored-by: Mingholy <mingholy.lmh@gmail.com>
This commit is contained in:
Peter Stewart
2025-09-18 15:04:27 +10:00
committed by GitHub
parent 17cdce6298
commit 724c24933c
4 changed files with 36 additions and 23 deletions

View File

@@ -191,14 +191,12 @@ describe('ReadManyFilesTool', () => {
);
});
it('should throw error if include array contains non-string elements', () => {
it('should coerce non-string elements in include array', () => {
const params = {
paths: ['file1.txt'],
include: ['*.ts', 123] as string[],
};
expect(() => tool.build(params)).toThrow(
'params/include/1 must be string',
);
expect(() => tool.build(params)).toBeDefined();
});
it('should throw error if exclude array contains non-string elements', () => {