diff --git a/backend/ai-core/internal/background/thinker.go b/backend/ai-core/internal/background/thinker.go index d271eef..b9c4764 100644 --- a/backend/ai-core/internal/background/thinker.go +++ b/backend/ai-core/internal/background/thinker.go @@ -1660,8 +1660,8 @@ func (t *Thinker) buildThinkingUserPrompt( sb.WriteString("刚有人和你聊完天。你想自然地在心里回味一下刚才的对话……\n") case "silence": t.muLock() - defer t.muUnlock() silenceDuration := time.Since(t.lastUserTime()) + t.muUnlock() sb.WriteString(fmt.Sprintf("已经大约 %s 没有说话了。你有点想知道大家在做什么……\n", formatDurationHuman(silenceDuration))) @@ -1760,7 +1760,7 @@ func (t *Thinker) buildThinkingUserPrompt( // OBv11 platform identity and available channels for proactive messaging. t.muLock() - defer t.muUnlock() + t.muUnlock() qqChannels := t.platformChannels botUIDs := t.botUIDs activeSID := t.activeSessionID diff --git a/backend/platform-bridge/cmd/main.go b/backend/platform-bridge/cmd/main.go index 1e9a8c6..8a44bd7 100644 --- a/backend/platform-bridge/cmd/main.go +++ b/backend/platform-bridge/cmd/main.go @@ -211,8 +211,16 @@ func main() { response = &bridge.UnifiedResponse{Messages: []bridge.ResponseMessage{{DisplayType: "silent"}}, Platform: msg.Platform} case isAdmin: - msg.RouteType = "normal" - response, routeErr = forwardToAICore(cfg, msg, "text", chatUserID, groupSessionID, imageURLs, videoURLs, voiceURLs, isAdmin) + // 管理员在群里@别人(非bot)时,用 group_ambient 避免昔涟频繁插嘴 + if msg.ChannelType == "group" && !isBotMentioned { + msg.RouteType = "group_ambient" + namespace := buildMemoryNamespace(msg.Platform, msg.ChannelType, msg.ChannelID) + fireSilent(namespace, imageURLs, videoURLs, voiceURLs) + response, routeErr = forwardToAICore(cfg, msg, "group_ambient", chatUserID, groupSessionID, imageURLs, videoURLs, voiceURLs, isAdmin) + } else { + msg.RouteType = "normal" + response, routeErr = forwardToAICore(cfg, msg, "text", chatUserID, groupSessionID, imageURLs, videoURLs, voiceURLs, isAdmin) + } case isBotMentioned: msg.RouteType = "normal"