fix(chat): emit retrieval references when citation output is disabled
Decouple the references SSE event from the per-agent citation output toggle so the retrieval-results drawer still works, and align follow-up suggestion card layout with the chat column.
This commit is contained in:
@@ -1189,10 +1189,12 @@ func (s *sessionService) consumeFallbackStream(
|
||||
}
|
||||
|
||||
// emitKnowledgeReferencesEvent streams retrieved chunks to the client as a
|
||||
// `references` SSE event. Must run before CHAT_COMPLETION_STREAM so citations
|
||||
// arrive while the connection is still open (complete closes the stream).
|
||||
// `references` SSE event. These references drive the retrieval-results UI and
|
||||
// remain available even when inline citations in the model answer are disabled.
|
||||
// Must run before CHAT_COMPLETION_STREAM so the event arrives while the
|
||||
// connection is still open (complete closes the stream).
|
||||
func emitKnowledgeReferencesEvent(ctx context.Context, chatManage *types.ChatManage) {
|
||||
if chatManage == nil || !chatManage.CitationsEnabled() || chatManage.EventBus == nil || len(chatManage.MergeResult) == 0 {
|
||||
if chatManage == nil || chatManage.EventBus == nil || len(chatManage.MergeResult) == 0 {
|
||||
return
|
||||
}
|
||||
logger.Infof(ctx, "Emitting references event with %d results (pre-answer)", len(chatManage.MergeResult))
|
||||
|
||||
Reference in New Issue
Block a user