fix: buildThinkingUserPrompt嵌套锁死锁 + 管理员群聊路由优化

- thinker.go:1662/1762 defer t.muUnlock→立即解锁,消除buildThinkingUserPrompt自死锁
  (1662持锁后1762再Lock→同goroutine自死锁→23h锁泄露→3769 goroutine泄漏)
- platform-bridge: 管理员在群里@别人走group_ambient而非normal,避免频繁插嘴
This commit is contained in:
2026-06-30 12:41:24 +08:00
parent 88755e131a
commit ddb1120ee1
2 changed files with 12 additions and 4 deletions
+10 -2
View File
@@ -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"