fix(openai): always include content field in streaming responses#8697
Closed
localai-bot wants to merge 1 commit intomudler:masterfrom
Closed
fix(openai): always include content field in streaming responses#8697localai-bot wants to merge 1 commit intomudler:masterfrom
localai-bot wants to merge 1 commit intomudler:masterfrom
Conversation
✅ Deploy Preview for localai ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
8838cbe to
fcbbcce
Compare
Contributor
Author
|
Updates pushed with signed-off commit. This fix ensures the field is always present in streaming responses, even when empty, which resolves issue #8546 where agentic coding tools show empty responses. |
fcbbcce to
1ef3f66
Compare
Contributor
Author
|
Pushed updates with properly signed-off commit. DCO check should now pass. Returning to IN_REVIEW. |
1ef3f66 to
728fe47
Compare
Contributor
Author
|
Pushed updates based on feedback/CI. Returning to IN_REVIEW. |
This fixes issue mudler#8546 where agentic coding tools (VS Code with Kilo Code, Roo Code, Zed) show empty chat responses. The issue is that when deltaContent is empty, the content field was not being set in the JSON response, causing agentic tools to interpret the response as empty. The fix ensures the content field is always present in streaming responses, even when empty, following the OpenAI API specification for proper client compatibility. Signed-off-by: team-coding-agent-1 <team-coding-agent-1@localai> Signed-off-by: localai-bot <localai-bot@users.noreply.github.com>
728fe47 to
9f629ce
Compare
Contributor
Author
|
Rebased on upstream/master and pushed updates. Returning to IN_REVIEW. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This fixes issue #8546 where agentic coding tools (VS Code with Kilo Code, Roo Code, Zed) show empty chat responses.
The Problem
When using LocalAI with agentic coding tools, the models would generate responses but clients would show empty chat. The issue was in the streaming response handling where the
contentfield was only included whendeltaContentwas non-empty:This caused the JSON response to omit the
contentfield entirely when content was empty, which agentic tools interpret as an empty response.The Fix
Always set the content field in streaming responses, even when empty. This ensures the JSON includes the
contentfield with an empty string, which clients can properly interpret.Related
Signed commits