diff --git a/open-sse/executors/base.ts b/open-sse/executors/base.ts index 3e73bbef38..f4e036f341 100644 --- a/open-sse/executors/base.ts +++ b/open-sse/executors/base.ts @@ -281,6 +281,9 @@ export class BaseExecutor { if (toolFunction && typeof toolFunction === "object" && !Array.isArray(toolFunction)) { const func = { ...(toolFunction as JsonRecord) }; if (func.description === "") delete func.description; + if (typeof func.name !== "string" || func.name.trim() === "") { + func.name = "unnamed_tool"; + } return { ...toolRecord, function: func }; } }