Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

fix(im): unblock agent stream wait when QA fails before complete event

wizardchene6b3ef4f7353
diff --git a/internal/im/service.go b/internal/im/service.go
index a1d81fcec..aad24f9a9 100644
--- a/internal/im/service.go
+++ b/internal/im/service.go
@@ -1931,6 +1931,7 @@ func (s *Service) handleMessageStream(ctx context.Context, msg *IncomingMessage,
qaErr = fmt.Errorf("QA pipeline error: %s", data.Error)
bufMu.Unlock()
closeDone()
+ closeComplete()
return nil
})
@@ -2102,6 +2103,7 @@ func (s *Service) handleMessageStream(ctx context.Context, msg *IncomingMessage,
qaErr = fmt.Errorf("QA execution error: %w", err)
bufMu.Unlock()
closeDone()
+ closeComplete()
}
}()
@@ -2252,6 +2254,7 @@ func (s *Service) runQA(ctx context.Context, session *types.Session, query strin
qaErr = fmt.Errorf("QA pipeline error: %s", data.Error)
answerMu.Unlock()
closeDone()
+ closeComplete()
return nil
})
@@ -2328,6 +2331,7 @@ func (s *Service) runQA(ctx context.Context, session *types.Session, query strin
qaErr = fmt.Errorf("QA execution error: %w", err)
answerMu.Unlock()
closeDone()
+ closeComplete()
}
}()