WeKnora/internal/application/service/chat_pipline
lyingbug e5c46642e9 fix: handle thinking stream edge cases (unclosed tags + missing done)
Two related fixes for thinking mode streaming:

1. chat_completion_stream.go: When the response channel closes
   unexpectedly (context cancelled, upstream error) while thinking
   is in progress, the <think> tag was left unclosed. This caused
   the stored message to have an incomplete tag, making the frontend
   show a perpetual "thinking..." state on history reload.
   Now we emit a closing </think> tag when the channel ends with
   thinkingStarted=true but thinkingEnded=false.

2. remote_api.go: The thinking Done=true event was only sent when
   the first answer content chunk arrived. If the model produced
   only reasoning with no answer (e.g., finish_reason set with
   empty content), the thinking-done signal was never emitted.
   Now we also check isDone && state.hasThinking at the end of
   processStreamDelta to ensure the done event is always sent.
2026-03-25 22:08:29 +08:00
..
chat_completion.go feat: Enhance agent configuration and localization for web search prompts 2025-11-19 19:27:25 +08:00
chat_completion_stream.go fix: handle thinking stream edge cases (unclosed tags + missing done) 2026-03-25 22:08:29 +08:00
chat_pipline.go refactor: Implement event-driven streaming and enhance session management 2025-11-07 22:41:41 +08:00
chat_pipline_test.go init commit 2025-08-05 15:08:07 +08:00
common.go feat: enhance localization and configuration support 2026-03-17 22:23:24 +08:00
data_analysis.go fix(data-analysis): load knowledge files via presigned URLs 2026-02-10 11:44:25 +08:00
extract_entity.go feat(kbshare): enhance sharing functionality with soft-delete handling and shared access 2026-02-09 11:40:25 +08:00
filter_top_k.go feat: Revamp conversation configuration management and enhance localization 2025-11-18 23:18:43 +08:00
into_chat_message.go feat: enhance localization and configuration support 2026-03-17 22:23:24 +08:00
load_history.go feat: enhance multimodal image processing and session management 2026-03-16 02:26:47 +08:00
memory.go feat: enhance document loading and state management in doc-content component 2026-03-02 21:21:49 +08:00
merge.go feat: enhance input field and agent stream display with improved handling and sanitization 2026-03-16 02:26:47 +08:00
merge_expand.go feat: enhance input field and agent stream display with improved handling and sanitization 2026-03-16 02:26:47 +08:00
merge_faq.go feat: enhance input field and agent stream display with improved handling and sanitization 2026-03-16 02:26:47 +08:00
merge_history.go feat: enhance input field and agent stream display with improved handling and sanitization 2026-03-16 02:26:47 +08:00
merge_overlap.go feat: enhance input field and agent stream display with improved handling and sanitization 2026-03-16 02:26:47 +08:00
query_expansion.go feat: implement parent-child chunking strategy for enhanced context management 2026-03-05 18:14:14 +08:00
rerank.go fix: improve markdown table cleaning and filter empty passages in rerank (#752) 2026-03-25 22:08:29 +08:00
rerank_clean_test.go fix: improve markdown table cleaning and filter empty passages in rerank (#752) 2026-03-25 22:08:29 +08:00
rewrite.go feat: enhance localization and configuration support 2026-03-17 22:23:24 +08:00
search.go feat: enhance knowledge search by resolving embedding model keys 2026-03-16 02:26:47 +08:00
search_entity.go feat: enhance document loading and state management in doc-content component 2026-03-02 21:21:49 +08:00
search_parallel.go feat: implement image upload and multimodal support 2026-03-16 02:26:47 +08:00
stream_filter.go feat: Revamp conversation configuration management and enhance localization 2025-11-18 23:18:43 +08:00
tracing.go feat: Implement parallel search functionality combining chunk and entity searches, enhancing retrieval efficiency and result accuracy 2025-12-03 17:45:21 +08:00