You've already forked agentic-coding-workflow
fix(chat): NewStreamerHub accepts ConversationService interface; SSE handler drains ready events before ctx
This commit is contained in:
@@ -107,23 +107,32 @@ type streamerHub struct {
|
||||
}
|
||||
|
||||
// NewStreamerHub constructs a StreamerHub.
|
||||
// convSvc must be the concrete *conversationService produced by NewConversationService;
|
||||
// the type assertion lets callers in other packages pass the interface without needing
|
||||
// to import the unexported concrete type. Pass nil to skip title generation.
|
||||
func NewStreamerHub(
|
||||
repo Repository,
|
||||
registry clientGetter,
|
||||
dispatch notifyDispatcher,
|
||||
auditor audit.Recorder,
|
||||
convSvc *conversationService,
|
||||
convSvc ConversationService,
|
||||
log *slog.Logger,
|
||||
retention time.Duration,
|
||||
safetyPct float64,
|
||||
) StreamerHub {
|
||||
var concrete *conversationService
|
||||
if convSvc != nil {
|
||||
if c, ok := convSvc.(*conversationService); ok {
|
||||
concrete = c
|
||||
}
|
||||
}
|
||||
return &streamerHub{
|
||||
byMsgID: make(map[int64]*streamer),
|
||||
repo: repo,
|
||||
registry: registry,
|
||||
dispatch: dispatch,
|
||||
auditor: auditor,
|
||||
convSvc: convSvc,
|
||||
convSvc: concrete,
|
||||
log: log,
|
||||
retention: retention,
|
||||
safety: safetyPct,
|
||||
|
||||
Reference in New Issue
Block a user