Bug description Inside org.springframework.ai.openai.api.OpenAiStreamFunctionCallingHelper at line 114: ```java if (currentToolCall.id() != null) { //HERE if (lastPreviousTooCall != null) { toolCalls.add(lastPreviousTooCall); } toolCalls.add(currentToolCall); } else { toolCalls.add(merge(lastPreviousTooCall, currentToolCall)); } ```` The current logic for merging ToolCallChunk streams assumes that the tool call ID will be null. However, some API implementations, such as Aliyun Model Studio, return an empty string ("") instead.

This discrepancy causes the merge logic to fail, preventing partial tool call chunks from being correctly assembled into a single function call.

A simple fix is to change the null check to a more robust blank string check (e.g., StringUtils.isBlank()). This will resolve the issue with Aliyun models and improve the overall compatibility of Spring AI with different API providers.

Comment From: sunyuhan1998

I guess you're currently not using the latest version of Spring AI? Actually, this issue has already been fixed in the latest code:

https://github.com/spring-projects/spring-ai/blob/940bcf30aa8b7f478b9515f238269681c1a9a9c0/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiStreamFunctionCallingHelper.java#L126-L134

Comment From: Yuumi-zoomie

@sunyuhan1998, yes I'm using spring-ai-openai-spring-boot-starter version 1.0.0-M6