Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/shared-adapter/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,14 @@ export function convertDeltaToMessageChunk(
function_call?: any
reasoning_content?: string
} = {}
if (delta.function_call) {
// Some proxies (e.g. DeepSeek V4 relays) emit an empty function_call
// object ({ arguments: '', name: '' }) on the final tool_calls chunk.
// Ignore it so the agent does not see a phantom empty tool call.
if (
delta.function_call &&
((delta.function_call.name?.length ?? 0) > 0 ||
(delta.function_call.arguments?.length ?? 0) > 0)
) {
additionalKwargs.function_call = delta.function_call
}

Expand Down
Loading