diff --git a/src/core/prompts/tools/native-tools/browser_action.ts b/src/core/prompts/tools/native-tools/browser_action.ts index 0a13d168f9e..2ff4b1cf9b8 100644 --- a/src/core/prompts/tools/native-tools/browser_action.ts +++ b/src/core/prompts/tools/native-tools/browser_action.ts @@ -22,7 +22,7 @@ export default { function: { name: "browser_action", description: BROWSER_ACTION_DESCRIPTION, - strict: true, + strict: false, parameters: { type: "object", properties: { diff --git a/src/core/prompts/tools/native-tools/read_file.ts b/src/core/prompts/tools/native-tools/read_file.ts index 3a5dfd081bc..bf43f26c8af 100644 --- a/src/core/prompts/tools/native-tools/read_file.ts +++ b/src/core/prompts/tools/native-tools/read_file.ts @@ -55,6 +55,10 @@ export function createReadFileTool(partialReadsEnabled: boolean = true): OpenAI. } } + // When using strict mode, ALL properties must be in the required array + // Optional properties are handled by having type: ["...", "null"] + const fileRequiredProperties = partialReadsEnabled ? ["path", "line_ranges"] : ["path"] + return { type: "function", function: { @@ -70,7 +74,7 @@ export function createReadFileTool(partialReadsEnabled: boolean = true): OpenAI. items: { type: "object", properties: fileProperties, - required: ["path"], + required: fileRequiredProperties, additionalProperties: false, }, minItems: 1,