Repository navigation
fix: custom empty_response not shown in streaming chat (Go mode) - #16989
Merged
Merged
Conversation
In the Go chat pipeline, the empty_response fallback was sent as a single Final=true result. The streaming handler in chat_session.go ignores the answer text on Final=true results (treats them as stream-close signals), so the custom empty_response message was never displayed to the user. Mirror Python dialog_service.py by yielding two results: 1. Final=false with the empty_response text (consumed by streaming) 2. Final=true with empty answer text + reference/prompt/TTS metadata This fixes the case where a user configures a custom empty_response but no message appears when no knowledge chunks are retrieved.
Contributor
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Jul 20, 2026
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.
Summary
Fix the issue where a user-configured custom
empty_responseis not displayed in the chat when no knowledge chunks are retrieved (Go mode).Root cause: In the Go chat pipeline (
internal/service/chat_pipeline.go), theempty_responsefallback was sent as a singleFinal=trueresult. The streaming handler inchat_session.goignores the answer text onFinal=trueresults (treating them purely as stream-close signals), so the customempty_responsemessage was never displayed to the user.Fix: Mirror the Python
dialog_service.pybehavior by yielding two results:Final=false— carries theempty_responsetext so streaming consumers display it.Final=true— closes the stream with reference/prompt/TTS metadata, with an emptyAnswerto avoid duplication in non-streaming accumulation mode.