fix: 主动消息同步推送到平台适配器(QQ)
This commit is contained in:
@@ -1987,8 +1987,24 @@ func (t *Thinker) storeThought(content string, toolCallsJSON string, toolCallCou
|
||||
t.convStore.AddMessage(pushSessionID, model.LLMMessage{Role: model.RoleAssistant, Content: proactiveMsg})
|
||||
}
|
||||
} else {
|
||||
log.Printf("[后台思考] 推送主动消息: %%s", proactiveMsg)
|
||||
log.Printf("[后台思考] 推送主动消息: %s", proactiveMsg)
|
||||
pusher(t.adminUserID, pushSessionID, proactiveMsg)
|
||||
// 同步推送到 QQ 私聊
|
||||
if platformPusher != nil {
|
||||
t.mu.Lock()
|
||||
channels := t.platformChannels
|
||||
t.mu.Unlock()
|
||||
for _, ch := range channels {
|
||||
if ch.ChannelType == "direct" {
|
||||
uid := strings.TrimPrefix(ch.ChannelID, "private_")
|
||||
target := ProactiveTarget{Platform: ch.AdapterName, ChatType: "private", UserID: uid}
|
||||
if target.Platform == "" { target.Platform = ch.Platform }
|
||||
log.Printf("[后台思考] 同步推送主动消息到平台: %s/%s user=%s", target.Platform, target.ChatType, target.UserID)
|
||||
platformPusher(target, proactiveMsg)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if t.convStore != nil && pushSessionID != "" {
|
||||
t.convStore.AddMessage(pushSessionID, model.LLMMessage{Role: model.RoleAssistant, Content: proactiveMsg})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user