From cd66dff55bee24d081879f033679f08b49a5c3f9 Mon Sep 17 00:00:00 2001 From: centdix <40307056+centdix@users.noreply.github.com> Date: Sun, 14 Dec 2025 23:27:03 +0100 Subject: [PATCH] fix(rawapp): schema for openai (#7364) --- frontend/src/lib/components/copilot/chat/app/core.ts | 4 ++-- frontend/src/lib/components/copilot/chat/shared.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/components/copilot/chat/app/core.ts b/frontend/src/lib/components/copilot/chat/app/core.ts index 39a0e9ceae..ec305c51a4 100644 --- a/frontend/src/lib/components/copilot/chat/app/core.ts +++ b/frontend/src/lib/components/copilot/chat/app/core.ts @@ -237,7 +237,8 @@ const getSetBackendRunnableToolDef = memo(() => createToolDef( getSetBackendRunnableSchema(), 'set_backend_runnable', - 'Create or update a backend runnable. Use type "inline" for custom code, or reference existing workspace/hub scripts/flows. Returns lint diagnostics (errors and warnings).' + 'Create or update a backend runnable. Use type "inline" for custom code, or reference existing workspace/hub scripts/flows. Returns lint diagnostics (errors and warnings).', + { strict: false } ) ) @@ -294,7 +295,6 @@ const getListWorkspaceRunnablesSchema = memo(() => query: z.string().describe('The search query to find workspace scripts and flows'), type: z .enum(['all', 'scripts', 'flows']) - .optional() .describe( 'Filter by type: "scripts" for scripts only, "flows" for flows only, "all" for both. Defaults to "all".' ) diff --git a/frontend/src/lib/components/copilot/chat/shared.ts b/frontend/src/lib/components/copilot/chat/shared.ts index 286197ecd0..ac92350a68 100644 --- a/frontend/src/lib/components/copilot/chat/shared.ts +++ b/frontend/src/lib/components/copilot/chat/shared.ts @@ -506,7 +506,8 @@ export interface ToolCallbacks { export function createToolDef( zodSchema: z.ZodSchema, name: string, - description: string + description: string, + { strict = true }: { strict?: boolean } = {} // we sometimes have to set strict to false for open ai models to avoid issues with complex properties ): ChatCompletionFunctionTool { // console.log('creating tool def for', name, zodSchema) let parameters = z.toJSONSchema(zodSchema) @@ -516,7 +517,7 @@ export function createToolDef( return { type: 'function', function: { - strict: true, + strict, name, description, parameters