fix: skip function_call items with empty/missing name to prevent Codex 400 error (closes #444) (#487)
This commit is contained in:
@@ -87,6 +87,8 @@ export function convertResponsesApiFormat(body) {
|
||||
tool_calls: []
|
||||
};
|
||||
}
|
||||
// Skip items with empty/missing name — upstream APIs reject nameless tool calls (#444)
|
||||
if (!item.name || typeof item.name !== "string" || item.name.trim() === "") continue;
|
||||
currentAssistantMsg.tool_calls.push({
|
||||
id: item.call_id,
|
||||
type: "function",
|
||||
|
||||
@@ -75,6 +75,8 @@ export function openaiResponsesToOpenAIRequest(model, body, stream, credentials)
|
||||
tool_calls: []
|
||||
};
|
||||
}
|
||||
// Skip items with empty/missing name — Codex/OpenAI reject nameless tool calls (#444)
|
||||
if (!item.name || typeof item.name !== "string" || item.name.trim() === "") continue;
|
||||
currentAssistantMsg.tool_calls.push({
|
||||
id: item.call_id,
|
||||
type: "function",
|
||||
|
||||
Reference in New Issue
Block a user