Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(openai): prevent incorrect ToolCall merging caused by empty id and name strings #2589

Closed
wants to merge 1 commit into from

Conversation

yangtuooc
Copy link
Contributor

@yangtuooc yangtuooc commented Mar 29, 2025

Empty tool call id and name strings causing improper ToolCall merging during OpenAI stream
processing, resulting in incorrect function calling responses. This fix ensures both null
and empty strings are properly validated before merging operations.

Fixes #2417 (#2417)
Fixes #2423 (#2423)

@DannySortino
Copy link

I shaded this change in to test since I have similar issue. We should also look to fix for toolname being blank - line 147 specifically. When i did same has text check, it made the merge work even when name was not present. Possibly worth adding that into this fix as well.

@yangtuooc yangtuooc changed the title fix(openai): prevent incorrect ToolCall merging caused by empty id strings fix(openai): prevent incorrect ToolCall merging caused by empty id and name strings Mar 30, 2025
@yangtuooc yangtuooc force-pushed the GH-2417 branch 2 times, most recently from b833451 to c9e1077 Compare March 30, 2025 08:52
…d name strings

Empty tool call id and name strings causing improper ToolCall merging during OpenAI stream
processing, resulting in incorrect function calling responses. This fix ensures both null
and empty strings are properly validated before merging operations.

Fixes spring-projectsGH-2417 (spring-projects#2417)
Fixes spring-projectsGH-2423 (spring-projects#2423)

Signed-off-by: Wenhao Ma <[email protected]>
@ilayaperumalg
Copy link
Member

@yangtuooc Thanks for fixing the issue. Rebased and merged as e888895

@yangtuooc yangtuooc deleted the GH-2417 branch April 1, 2025 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

toolName cannot be null or empty in Flux stream toolInput cannot be null or empty
3 participants