diff --git a/src/tool/builtin/readFile.ts b/src/tool/builtin/readFile.ts index e3d470d9..8b9724e2 100644 --- a/src/tool/builtin/readFile.ts +++ b/src/tool/builtin/readFile.ts @@ -94,6 +94,10 @@ export function createReadFileTool(): PilotDeckToolDefinition { issues: [{ path: "limit", code: "invalid_schema", message: "limit must be greater than or equal to 0." }], }; } + if (typeof input.pages === "string" && input.pages.trim().length === 0) { + const { pages: _pages, ...rest } = input; + input = rest as ReadFileInput; + } if (input.pages !== undefined) { const parsed = parsePdfPageRange(input.pages); if (!parsed) {