refactor: trim function name consistently in Responses-to-Chat direction

Addresses PR review: both translation directions now trim the function
name the same way, matching the Chat-to-Responses pattern.
This commit is contained in:
Prakersh Maheshwari
2026-03-17 02:35:42 +05:30
parent ce978b602a
commit ef623c9bb5

View File

@@ -121,8 +121,8 @@ export function openaiResponsesToOpenAIRequest(
if (itemType === "function_call") {
// Skip tool calls with empty names to avoid infinite placeholder_tool loops
const fnName = toString(item.name);
if (!fnName || !fnName.trim()) {
const fnName = toString(item.name).trim();
if (!fnName) {
continue;
}