feat: inject fallback tool names to prevent upstream 400 errors (#1775)

This commit is contained in:
Antigravity Assistant
2026-04-30 12:52:26 -03:00
parent 19df6472c9
commit b2572acdbf

View File

@@ -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 };
}
}